Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
SorbettoStrategy
Compiler Version
v0.7.6+commit.7338295f
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2021-06-28 */ // SPDX-License-Identifier: MIT pragma solidity 0.7.6; interface ISorbettoStrategy { /// @notice Period of time that we observe for price slippage /// @return time in seconds function twapDuration() external view returns (uint32); /// @notice Maximum deviation of time waited avarage price in ticks function maxTwapDeviation() external view returns (int24); /// @notice Tick multuplier for base range calculation function tickRangeMultiplier() external view returns (int24); /// @notice The protocol's fee denominated in hundredths of a bip, i.e. 1e-6 /// @return The fee function protocolFee() external view returns (uint24); /// @notice The price impact percentage during swap denominated in hundredths of a bip, i.e. 1e-6 /// @return The max price impact percentage function priceImpactPercentage() external view returns (uint24); } /// @title Permissioned Sorbetto variables /// @notice Contains Sorbetto variables that may only be called by the governance contract SorbettoStrategy is ISorbettoStrategy { // Address of the Sorbetto's strategy owner address public governance; // Pending to claim ownership address address public pendingGovernance; /// @inheritdoc ISorbettoStrategy uint32 public override twapDuration; /// @inheritdoc ISorbettoStrategy int24 public override maxTwapDeviation; /// @inheritdoc ISorbettoStrategy int24 public override tickRangeMultiplier; /// @inheritdoc ISorbettoStrategy uint24 public override protocolFee; /// @inheritdoc ISorbettoStrategy uint24 public override priceImpactPercentage; /** * @param _twapDuration TWAP duration in seconds for rebalance check * @param _maxTwapDeviation Max deviation from TWAP during rebalance * @param _tickRangeMultiplier Used to determine base order range * @param _protocolFee The protocol's fee in hundredths of a bip, i.e. 1e-6 * @param _priceImpactPercentage The price impact percentage during swap in hundredths of a bip, i.e. 1e-6 */ constructor( uint32 _twapDuration, int24 _maxTwapDeviation, int24 _tickRangeMultiplier, uint24 _protocolFee, uint24 _priceImpactPercentage ) { twapDuration = _twapDuration; maxTwapDeviation = _maxTwapDeviation; tickRangeMultiplier = _tickRangeMultiplier; protocolFee = _protocolFee; priceImpactPercentage = _priceImpactPercentage; governance = msg.sender; require(_maxTwapDeviation >= 0, "maxTwapDeviation"); require(_twapDuration > 0, "twapDuration"); require(_protocolFee < 1e6 && _protocolFee > 0, "PF"); require(_priceImpactPercentage < 1e6 && _priceImpactPercentage > 0, "PIP"); } modifier onlyGovernance { require(msg.sender == governance, "NOT ALLOWED"); _; } function setTwapDuration(uint32 _twapDuration) external onlyGovernance { require(_twapDuration > 0, "twapDuration"); twapDuration = _twapDuration; } function setMaxTwapDeviation(int24 _maxTwapDeviation) external onlyGovernance { require(_maxTwapDeviation > 0, "PF"); maxTwapDeviation = _maxTwapDeviation; } function setTickRange(int24 _tickRangeMultiplier) external onlyGovernance { tickRangeMultiplier = _tickRangeMultiplier; } function setProtocolFee(uint16 _protocolFee) external onlyGovernance { require(_protocolFee < 1e6 && _protocolFee > 0, "PF"); protocolFee = _protocolFee; } function setPriceImpact(uint16 _priceImpactPercentage) external onlyGovernance { require(_priceImpactPercentage < 1e6 && _priceImpactPercentage > 0, "PIP"); priceImpactPercentage = _priceImpactPercentage; } /** * @notice `setGovernance()` should be called by the existing governance * address prior to calling this function. */ function setGovernance(address _governance) external onlyGovernance { pendingGovernance = _governance; } /** * @notice Governance address is not updated until the new governance * address has called `acceptGovernance()` to accept this responsibility. */ function acceptGovernance() external { require(msg.sender == pendingGovernance, "PG"); governance = msg.sender; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"uint32","name":"_twapDuration","type":"uint32"},{"internalType":"int24","name":"_maxTwapDeviation","type":"int24"},{"internalType":"int24","name":"_tickRangeMultiplier","type":"int24"},{"internalType":"uint24","name":"_protocolFee","type":"uint24"},{"internalType":"uint24","name":"_priceImpactPercentage","type":"uint24"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"acceptGovernance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"governance","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTwapDeviation","outputs":[{"internalType":"int24","name":"","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingGovernance","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceImpactPercentage","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFee","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_governance","type":"address"}],"name":"setGovernance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int24","name":"_maxTwapDeviation","type":"int24"}],"name":"setMaxTwapDeviation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_priceImpactPercentage","type":"uint16"}],"name":"setPriceImpact","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_protocolFee","type":"uint16"}],"name":"setProtocolFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int24","name":"_tickRangeMultiplier","type":"int24"}],"name":"setTickRange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_twapDuration","type":"uint32"}],"name":"setTwapDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tickRangeMultiplier","outputs":[{"internalType":"int24","name":"","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"twapDuration","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5060405161094e38038061094e833981810160405260a081101561003357600080fd5b5080516020820151604083015160608401516080909401516001805463ffffffff60a01b1916600160a01b63ffffffff8716021762ffffff60c01b1916600160c01b600286810b62ffffff818116939093029390931762ffffff60d81b1916600160d81b87830b84160217909355825462ffffff19168189161765ffffff00000019166301000000918516919091021790915560008054336001600160a01b0319909116178155949593949293921315610127576040805162461bcd60e51b815260206004820152601060248201526f36b0bc2a3bb0b82232bb34b0ba34b7b760811b604482015290519081900360640190fd5b60008563ffffffff1611610171576040805162461bcd60e51b815260206004820152600c60248201526b3a3bb0b8223ab930ba34b7b760a11b604482015290519081900360640190fd5b620f42408262ffffff1610801561018d575060008262ffffff16115b6101c3576040805162461bcd60e51b8152602060048201526002602482015261282360f11b604482015290519081900360640190fd5b620f42408162ffffff161080156101df575060008162ffffff16115b610216576040805162461bcd60e51b815260206004820152600360248201526205049560ec1b604482015290519081900360640190fd5b50505050506107248061022a6000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c80639414b45d1161008c578063c433c80a11610066578063c433c80a1461020c578063e4467f351461022f578063e7c7cb9114610250578063f39c38a014610258576100ea565b80639414b45d146101bd578063ab033ea9146101de578063b0e21e8a14610204576100ea565b806328a90bc2116100c857806328a90bc21461013a5780633cbff3fe146101595780635aa6e675146101795780636ce97e781461019d576100ea565b80630a701323146100ef578063238efcbc1461010f57806326d8954514610119575b600080fd5b6100f7610260565b6040805162ffffff9092168252519081900360200190f35b610117610272565b005b6101216102ca565b6040805163ffffffff9092168252519081900360200190f35b6101426102dd565b6040805160029290920b8252519081900360200190f35b6101176004803603602081101561016f57600080fd5b503560020b6102ed565b61018161039f565b604080516001600160a01b039092168252519081900360200190f35b610117600480360360208110156101b357600080fd5b503560020b6103ae565b610117600480360360208110156101d357600080fd5b503561ffff16610423565b610117600480360360208110156101f457600080fd5b50356001600160a01b03166104e3565b6100f7610552565b6101176004803603602081101561022257600080fd5b503563ffffffff1661055d565b6101176004803603602081101561024557600080fd5b503561ffff1661061a565b6101426106cf565b6101816106df565b6002546301000000900462ffffff1681565b6001546001600160a01b031633146102b6576040805162461bcd60e51b8152602060048201526002602482015261504760f01b604482015290519081900360640190fd5b600080546001600160a01b03191633179055565b600154600160a01b900463ffffffff1681565b600154600160d81b900460020b81565b6000546001600160a01b0316331461033a576040805162461bcd60e51b815260206004820152600b60248201526a1393d50810531313d5d15160aa1b604482015290519081900360640190fd5b60008160020b13610377576040805162461bcd60e51b8152602060048201526002602482015261282360f11b604482015290519081900360640190fd5b6001805460029290920b62ffffff16600160c01b0262ffffff60c01b19909216919091179055565b6000546001600160a01b031681565b6000546001600160a01b031633146103fb576040805162461bcd60e51b815260206004820152600b60248201526a1393d50810531313d5d15160aa1b604482015290519081900360640190fd5b6001805460029290920b62ffffff16600160d81b0262ffffff60d81b19909216919091179055565b6000546001600160a01b03163314610470576040805162461bcd60e51b815260206004820152600b60248201526a1393d50810531313d5d15160aa1b604482015290519081900360640190fd5b620f42408161ffff1610801561048a575060008161ffff16115b6104c1576040805162461bcd60e51b815260206004820152600360248201526205049560ec1b604482015290519081900360640190fd5b6002805465ffffff000000191661ffff92909216630100000002919091179055565b6000546001600160a01b03163314610530576040805162461bcd60e51b815260206004820152600b60248201526a1393d50810531313d5d15160aa1b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60025462ffffff1681565b6000546001600160a01b031633146105aa576040805162461bcd60e51b815260206004820152600b60248201526a1393d50810531313d5d15160aa1b604482015290519081900360640190fd5b60008163ffffffff16116105f4576040805162461bcd60e51b815260206004820152600c60248201526b3a3bb0b8223ab930ba34b7b760a11b604482015290519081900360640190fd5b6001805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b6000546001600160a01b03163314610667576040805162461bcd60e51b815260206004820152600b60248201526a1393d50810531313d5d15160aa1b604482015290519081900360640190fd5b620f42408161ffff16108015610681575060008161ffff16115b6106b7576040805162461bcd60e51b8152602060048201526002602482015261282360f11b604482015290519081900360640190fd5b6002805462ffffff191661ffff909216919091179055565b600154600160c01b900460020b81565b6001546001600160a01b03168156fea264697066735822122038a11097483ed3e299f8ef01f2a135152266fbfa6a6ba2639aad507d29ba2c7264736f6c6343000706003300000000000000000000000000000000000000000000000000000000000000960000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000007d0
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80639414b45d1161008c578063c433c80a11610066578063c433c80a1461020c578063e4467f351461022f578063e7c7cb9114610250578063f39c38a014610258576100ea565b80639414b45d146101bd578063ab033ea9146101de578063b0e21e8a14610204576100ea565b806328a90bc2116100c857806328a90bc21461013a5780633cbff3fe146101595780635aa6e675146101795780636ce97e781461019d576100ea565b80630a701323146100ef578063238efcbc1461010f57806326d8954514610119575b600080fd5b6100f7610260565b6040805162ffffff9092168252519081900360200190f35b610117610272565b005b6101216102ca565b6040805163ffffffff9092168252519081900360200190f35b6101426102dd565b6040805160029290920b8252519081900360200190f35b6101176004803603602081101561016f57600080fd5b503560020b6102ed565b61018161039f565b604080516001600160a01b039092168252519081900360200190f35b610117600480360360208110156101b357600080fd5b503560020b6103ae565b610117600480360360208110156101d357600080fd5b503561ffff16610423565b610117600480360360208110156101f457600080fd5b50356001600160a01b03166104e3565b6100f7610552565b6101176004803603602081101561022257600080fd5b503563ffffffff1661055d565b6101176004803603602081101561024557600080fd5b503561ffff1661061a565b6101426106cf565b6101816106df565b6002546301000000900462ffffff1681565b6001546001600160a01b031633146102b6576040805162461bcd60e51b8152602060048201526002602482015261504760f01b604482015290519081900360640190fd5b600080546001600160a01b03191633179055565b600154600160a01b900463ffffffff1681565b600154600160d81b900460020b81565b6000546001600160a01b0316331461033a576040805162461bcd60e51b815260206004820152600b60248201526a1393d50810531313d5d15160aa1b604482015290519081900360640190fd5b60008160020b13610377576040805162461bcd60e51b8152602060048201526002602482015261282360f11b604482015290519081900360640190fd5b6001805460029290920b62ffffff16600160c01b0262ffffff60c01b19909216919091179055565b6000546001600160a01b031681565b6000546001600160a01b031633146103fb576040805162461bcd60e51b815260206004820152600b60248201526a1393d50810531313d5d15160aa1b604482015290519081900360640190fd5b6001805460029290920b62ffffff16600160d81b0262ffffff60d81b19909216919091179055565b6000546001600160a01b03163314610470576040805162461bcd60e51b815260206004820152600b60248201526a1393d50810531313d5d15160aa1b604482015290519081900360640190fd5b620f42408161ffff1610801561048a575060008161ffff16115b6104c1576040805162461bcd60e51b815260206004820152600360248201526205049560ec1b604482015290519081900360640190fd5b6002805465ffffff000000191661ffff92909216630100000002919091179055565b6000546001600160a01b03163314610530576040805162461bcd60e51b815260206004820152600b60248201526a1393d50810531313d5d15160aa1b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60025462ffffff1681565b6000546001600160a01b031633146105aa576040805162461bcd60e51b815260206004820152600b60248201526a1393d50810531313d5d15160aa1b604482015290519081900360640190fd5b60008163ffffffff16116105f4576040805162461bcd60e51b815260206004820152600c60248201526b3a3bb0b8223ab930ba34b7b760a11b604482015290519081900360640190fd5b6001805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b6000546001600160a01b03163314610667576040805162461bcd60e51b815260206004820152600b60248201526a1393d50810531313d5d15160aa1b604482015290519081900360640190fd5b620f42408161ffff16108015610681575060008161ffff16115b6106b7576040805162461bcd60e51b8152602060048201526002602482015261282360f11b604482015290519081900360640190fd5b6002805462ffffff191661ffff909216919091179055565b600154600160c01b900460020b81565b6001546001600160a01b03168156fea264697066735822122038a11097483ed3e299f8ef01f2a135152266fbfa6a6ba2639aad507d29ba2c7264736f6c63430007060033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000960000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000007d0
-----Decoded View---------------
Arg [0] : _twapDuration (uint32): 150
Arg [1] : _maxTwapDeviation (int24): 40
Arg [2] : _tickRangeMultiplier (int24): 16
Arg [3] : _protocolFee (uint24): 100000
Arg [4] : _priceImpactPercentage (uint24): 2000
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000096
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000028
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000010
Arg [3] : 00000000000000000000000000000000000000000000000000000000000186a0
Arg [4] : 00000000000000000000000000000000000000000000000000000000000007d0
Deployed Bytecode Sourcemap
1044:3458:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1636:44;;;:::i;:::-;;;;;;;;;;;;;;;;;;;4363:136;;;:::i;:::-;;1304:35;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1469:41;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;3160:180;;;;;;;;;;;;;;;;-1:-1:-1;3160:180:0;;;;:::i;1149:25::-;;;:::i;:::-;;;;-1:-1:-1;;;;;1149:25:0;;;;;;;;;;;;;;3348:135;;;;;;;;;;;;;;;;-1:-1:-1;3348:135:0;;;;:::i;3677:229::-;;;;;;;;;;;;;;;;-1:-1:-1;3677:229:0;;;;:::i;4065:118::-;;;;;;;;;;;;;;;;-1:-1:-1;4065:118:0;-1:-1:-1;;;;;4065:118:0;;:::i;1556:34::-;;;:::i;2981:171::-;;;;;;;;;;;;;;;;-1:-1:-1;2981:171:0;;;;:::i;3491:178::-;;;;;;;;;;;;;;;;-1:-1:-1;3491:178:0;;;;:::i;1385:38::-;;;:::i;1224:32::-;;;:::i;1636:44::-;;;;;;;;;:::o;4363:136::-;4433:17;;-1:-1:-1;;;;;4433:17:0;4419:10;:31;4411:46;;;;;-1:-1:-1;;;4411:46:0;;;;;;;;;;;;-1:-1:-1;;;4411:46:0;;;;;;;;;;;;;;;4468:10;:23;;-1:-1:-1;;;;;;4468:23:0;4481:10;4468:23;;;4363:136::o;1304:35::-;;;-1:-1:-1;;;1304:35:0;;;;;:::o;1469:41::-;;;-1:-1:-1;;;1469:41:0;;;;;:::o;3160:180::-;2927:10;;-1:-1:-1;;;;;2927:10:0;2913;:24;2905:48;;;;;-1:-1:-1;;;2905:48:0;;;;;;;;;;;;-1:-1:-1;;;2905:48:0;;;;;;;;;;;;;;;3277:1:::1;3257:17;:21;;;3249:36;;;::::0;;-1:-1:-1;;;3249:36:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;3249:36:0;;;;;;;;;;;;;::::1;;3296:16;:36:::0;;::::1;::::0;;;::::1;;;-1:-1:-1::0;;;3296:36:0::1;-1:-1:-1::0;;;;3296:36:0;;::::1;::::0;;;::::1;::::0;;3160:180::o;1149:25::-;;;-1:-1:-1;;;;;1149:25:0;;:::o;3348:135::-;2927:10;;-1:-1:-1;;;;;2927:10:0;2913;:24;2905:48;;;;;-1:-1:-1;;;2905:48:0;;;;;;;;;;;;-1:-1:-1;;;2905:48:0;;;;;;;;;;;;;;;3433:19:::1;:42:::0;;::::1;::::0;;;::::1;;;-1:-1:-1::0;;;3433:42:0::1;-1:-1:-1::0;;;;3433:42:0;;::::1;::::0;;;::::1;::::0;;3348:135::o;3677:229::-;2927:10;;-1:-1:-1;;;;;2927:10:0;2913;:24;2905:48;;;;;-1:-1:-1;;;2905:48:0;;;;;;;;;;;;-1:-1:-1;;;2905:48:0;;;;;;;;;;;;;;;3800:3:::1;3775:22;:28;;;:58;;;;;3832:1;3807:22;:26;;;3775:58;3767:74;;;::::0;;-1:-1:-1;;;3767:74:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;3767:74:0;;;;;;;;;;;;;::::1;;3852:21;:46:::0;;-1:-1:-1;;3852:46:0::1;;::::0;;;::::1;::::0;::::1;::::0;;;::::1;::::0;;3677:229::o;4065:118::-;2927:10;;-1:-1:-1;;;;;2927:10:0;2913;:24;2905:48;;;;;-1:-1:-1;;;2905:48:0;;;;;;;;;;;;-1:-1:-1;;;2905:48:0;;;;;;;;;;;;;;;4144:17:::1;:31:::0;;-1:-1:-1;;;;;;4144:31:0::1;-1:-1:-1::0;;;;;4144:31:0;;;::::1;::::0;;;::::1;::::0;;4065:118::o;1556:34::-;;;;;;:::o;2981:171::-;2927:10;;-1:-1:-1;;;;;2927:10:0;2913;:24;2905:48;;;;;-1:-1:-1;;;2905:48:0;;;;;;;;;;;;-1:-1:-1;;;2905:48:0;;;;;;;;;;;;;;;3087:1:::1;3071:13;:17;;;3063:42;;;::::0;;-1:-1:-1;;;3063:42:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;3063:42:0;;;;;;;;;;;;;::::1;;3116:12;:28:::0;;::::1;::::0;;::::1;-1:-1:-1::0;;;3116:28:0::1;-1:-1:-1::0;;;;3116:28:0;;::::1;::::0;;;::::1;::::0;;2981:171::o;3491:178::-;2927:10;;-1:-1:-1;;;;;2927:10:0;2913;:24;2905:48;;;;;-1:-1:-1;;;2905:48:0;;;;;;;;;;;;-1:-1:-1;;;2905:48:0;;;;;;;;;;;;;;;3594:3:::1;3579:12;:18;;;:38;;;;;3616:1;3601:12;:16;;;3579:38;3571:53;;;::::0;;-1:-1:-1;;;3571:53:0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;3571:53:0;;;;;;;;;;;;;::::1;;3635:11;:26:::0;;-1:-1:-1;;3635:26:0::1;;::::0;;::::1;::::0;;;::::1;::::0;;3491:178::o;1385:38::-;;;-1:-1:-1;;;1385:38:0;;;;;:::o;1224:32::-;;;-1:-1:-1;;;;;1224:32:0;;:::o
Swarm Source
ipfs://38a11097483ed3e299f8ef01f2a135152266fbfa6a6ba2639aad507d29ba2c72
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.