Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- MigrationStaking
- Optimization enabled
- true
- Compiler version
- v0.8.19+commit.7dd6d404
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2024-09-26T15:33:07.191558Z
Contract source code
// SPDX-License-Identifier: No License (None) pragma solidity 0.8.19; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". * * Source https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/v2.1.3/contracts/ownership/Ownable.sol * This contract is copied here and renamed from the original to avoid clashes in the compiled artifacts * when the user imports a zos-lib contract (that transitively causes this contract to be compiled and added to the * build/artifacts folder) as well as the vanilla Ownable implementation from an openzeppelin version. */ contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } /** * @return the address of the owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(),"Not Owner"); _; } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { return msg.sender == _owner; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0),"Zero address not allowed"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } interface IERC223 { function mint(address _to, uint256 _amount) external; function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function burnFrom(address sender, uint256 amount) external returns (bool); function transfer(address recipient, uint256 amount) external; function balanceOf(address account) external view returns (uint256); } interface IStacking { struct Staker { uint256 amount; uint256 rewardPerSharePaid; uint64 endTime; // Time when staking ends and user may withdraw. After this time user will not receive rewards. uint64 index; // Balances indexed uint64 bonus; // percent of bonus applied uint32 affiliatePercent; // percent of user's rewards that will be transferred to affiliate, i.e. 5% uint32 noAffiliatePercent; // percent of user's rewards will be paid if no affiliate. address affiliate; // address of affiliate } function staker(address user) external view returns(Staker memory); } interface ISlothVesting { function allocateTokens( address to, // beneficiary of tokens uint256 amount // amount of token ) external; } interface IMigration { struct StakeRate { uint112 migratedAmount; uint112 reservedAmount; uint32 rate; } function stakingRateReserved(address user) external view returns(StakeRate memory); } contract MigrationStaking is Ownable { IMigration constant public MIGRATION = IMigration(0x346984a5a13241dAf2587571Ce7D86cEA77bfB7e); address constant public CLOE = address(0x1eAa43544dAa399b87EEcFcC6Fa579D5ea4A6187); address public slothVesting = address(0x98194aaA67638498547Df929DF4926C7D0DCD135); uint256 constant public startMigration = 1706745600; // timestamp when migration start 1 February 2024 00:00:00 UTC bool public isPause; uint256 public totalSlothMinted; uint256[] public periodEnd = [1706831999,1706918399,1707004799,1707091199,1707177599,1707263999,1707350399,1714521599]; // last period will ends on 30 April 2024 23:59:59 UTC uint256[] public soyRatio = [200,400,800,1000,2000,4000,8000,10000]; uint256[] public cloeRatio = [30,65,130,170,355,710,1415,1765]; uint256 public totalCLOEMigrated; uint256 public totalSOYMigrated; struct StakeRate { uint112 migratedAmount; uint112 reservedAmount; uint32 rate; } address[] public stakingContracts = [0x86F7e2ef599690b64f0063b3F978ea6Ae2814f63,0x7d6C70b6561C31935e6B0dd77731FC63D5aC37F2,0x19DcB402162b6937a8ACEac87Ed6c05219c9bEf7,0x31bFf88C6124E1622f81b3Ba7ED219e5d78abd98]; mapping(address user => StakeRate) public stakingRateReservedNew; uint256 public currentPeriod; event Migrate(address user, uint256 soyAmount, uint256 slothAmount); event MigrateCLOE(address user, uint256 cloeAmount, uint256 slothAmount); event StakingMigrate(address user, uint256 rate, uint256 migratedAmount, uint256 reservedAmount); event StakingFixRateMigration(address user, uint256 soyAmount, uint256 slothAmount); event SetPeriod(uint256 period, uint256 _periodEnd, uint256 _soyRatio, uint256 _cloeRatio); modifier migrationAllowed() { require(block.timestamp >= startMigration, "Migration is not started yet"); require(!isPause, "Migration is paused"); uint256 lastPeriod = periodEnd.length-1; while(periodEnd[currentPeriod] < block.timestamp) { require(currentPeriod < lastPeriod, "Migration finished"); // not a last period currentPeriod++; } _; } function getRates() external view returns(uint256 rateSOY, uint256 rateCLOE) { if(block.timestamp < startMigration) return (0,0); uint256 current = currentPeriod; uint256 lastPeriod = periodEnd.length-1; while(periodEnd[current] < block.timestamp) { if(current >= lastPeriod) return (0,0); current++; } rateSOY = soyRatio[current]; rateCLOE = cloeRatio[current]; } function tokenReceived(address, uint, bytes memory) external pure returns(bytes4) { revert("No Soy Migration"); } function migrateCLOE(uint256 amount) external { IERC223(CLOE).burnFrom(msg.sender, amount); migrate(msg.sender, amount, false); } function migrate(address user, uint256 amount, bool isSoy) internal migrationAllowed { uint256 slothAmount; if(isSoy) { slothAmount = amount / soyRatio[currentPeriod]; totalSOYMigrated += amount; emit Migrate(user, amount, slothAmount); } else { slothAmount = amount / cloeRatio[currentPeriod]; totalCLOEMigrated += amount; emit MigrateCLOE(user, amount, slothAmount); } totalSlothMinted += slothAmount; transferToVesting(user, slothAmount); } function stakingMigrate() external { stakingMigrateBehalf(msg.sender); } function stakingMigrateBatch(address[] calldata users) external { uint len = users.length; for (uint i; i<len; i++) stakingMigrateBehalf(users[i]); } function stakingMigrateBehalf(address user) public migrationAllowed { require(stakingRateReservedNew[user].rate == 0, "Already migrated"); uint256 migratedAmount; IMigration.StakeRate memory oldMigration = MIGRATION.stakingRateReserved(user); if (oldMigration.rate == 0) { // do new migration for (uint i; i<4; i++) { IStacking.Staker memory s = IStacking(stakingContracts[i]).staker(user); migratedAmount += s.amount; } stakingRateReservedNew[user] = StakeRate(uint112(migratedAmount),uint112(0),uint32(soyRatio[currentPeriod])); migrate(user, migratedAmount, true); emit StakingMigrate(user, soyRatio[currentPeriod], migratedAmount, 0); } else if (oldMigration.reservedAmount != 0) { // migrate reserved amount migratedAmount = oldMigration.reservedAmount + oldMigration.migratedAmount; stakingRateReservedNew[user] = StakeRate(uint112(migratedAmount),uint112(0),uint32(oldMigration.rate)); uint256 slothAmount = oldMigration.reservedAmount / oldMigration.rate; emit StakingFixRateMigration(user, oldMigration.reservedAmount, slothAmount); totalSOYMigrated += oldMigration.reservedAmount; totalSlothMinted += slothAmount; transferToVesting(user, slothAmount); } else revert("Already migrated"); } function stakingRateReserved(address user) public view returns (StakeRate memory stakeMigrated) { if (stakingRateReservedNew[user].rate == 0) { IMigration.StakeRate memory oldMigration = MIGRATION.stakingRateReserved(user); stakeMigrated.migratedAmount = oldMigration.migratedAmount; stakeMigrated.reservedAmount = oldMigration.reservedAmount; stakeMigrated.rate = oldMigration.rate; } else { return stakingRateReservedNew[user]; } } function transferToVesting(address user, uint256 amount) internal { ISlothVesting(slothVesting).allocateTokens(user, amount); } function setPause(bool pause) external onlyOwner { isPause = pause; } function setSlothVesting(address _slothVesting) external onlyOwner { slothVesting = _slothVesting; } function setPeriod(uint256 period, uint256 _periodEnd, uint256 _soyRatio, uint256 _cloeRatio) external onlyOwner { if (period < periodEnd.length) { periodEnd[period] = _periodEnd; soyRatio[period] = _soyRatio; cloeRatio[period] = _cloeRatio; } else { periodEnd.push(_periodEnd); soyRatio.push(_soyRatio); cloeRatio.push(_cloeRatio); } emit SetPeriod(period, _periodEnd, _soyRatio, _cloeRatio); } function rescueERC20(address token, address to) external onlyOwner { uint256 value = IERC223(token).balanceOf(address(this)); IERC223(token).transfer(to, value); } }
Contract ABI
[{"type":"event","name":"Migrate","inputs":[{"type":"address","name":"user","internalType":"address","indexed":false},{"type":"uint256","name":"soyAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"slothAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"MigrateCLOE","inputs":[{"type":"address","name":"user","internalType":"address","indexed":false},{"type":"uint256","name":"cloeAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"slothAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"SetPeriod","inputs":[{"type":"uint256","name":"period","internalType":"uint256","indexed":false},{"type":"uint256","name":"_periodEnd","internalType":"uint256","indexed":false},{"type":"uint256","name":"_soyRatio","internalType":"uint256","indexed":false},{"type":"uint256","name":"_cloeRatio","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"StakingFixRateMigration","inputs":[{"type":"address","name":"user","internalType":"address","indexed":false},{"type":"uint256","name":"soyAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"slothAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"StakingMigrate","inputs":[{"type":"address","name":"user","internalType":"address","indexed":false},{"type":"uint256","name":"rate","internalType":"uint256","indexed":false},{"type":"uint256","name":"migratedAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"reservedAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"CLOE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IMigration"}],"name":"MIGRATION","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"cloeRatio","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"currentPeriod","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"rateSOY","internalType":"uint256"},{"type":"uint256","name":"rateCLOE","internalType":"uint256"}],"name":"getRates","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isOwner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isPause","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"migrateCLOE","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"periodEnd","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"rescueERC20","inputs":[{"type":"address","name":"token","internalType":"address"},{"type":"address","name":"to","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPause","inputs":[{"type":"bool","name":"pause","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPeriod","inputs":[{"type":"uint256","name":"period","internalType":"uint256"},{"type":"uint256","name":"_periodEnd","internalType":"uint256"},{"type":"uint256","name":"_soyRatio","internalType":"uint256"},{"type":"uint256","name":"_cloeRatio","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSlothVesting","inputs":[{"type":"address","name":"_slothVesting","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"slothVesting","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"soyRatio","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"stakingContracts","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"stakingMigrate","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"stakingMigrateBatch","inputs":[{"type":"address[]","name":"users","internalType":"address[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"stakingMigrateBehalf","inputs":[{"type":"address","name":"user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"stakeMigrated","internalType":"struct MigrationStaking.StakeRate","components":[{"type":"uint112","name":"migratedAmount","internalType":"uint112"},{"type":"uint112","name":"reservedAmount","internalType":"uint112"},{"type":"uint32","name":"rate","internalType":"uint32"}]}],"name":"stakingRateReserved","inputs":[{"type":"address","name":"user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint112","name":"migratedAmount","internalType":"uint112"},{"type":"uint112","name":"reservedAmount","internalType":"uint112"},{"type":"uint32","name":"rate","internalType":"uint32"}],"name":"stakingRateReservedNew","inputs":[{"type":"address","name":"user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"startMigration","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"bytes4","name":"","internalType":"bytes4"}],"name":"tokenReceived","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"bytes","name":"","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalCLOEMigrated","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSOYMigrated","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSlothMinted","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
Contract Creation Code
0x600180546001600160a01b0319167398194aaa67638498547df929df4926c7d0dcd1351790556101806040526365bc307f60809081526365bd81ff60a0526365bed37f60c0526365c024ff60e0526365c1767f610100526365c2c7ff610120526365c4197f6101405263663185ff610160526200008190600390600862000208565b50604080516101008101825260c881526101906020820152610320918101919091526103e860608201526107d06080820152610fa060a0820152611f4060c082015261271060e0820152620000db90600490600862000260565b506040805161010081018252601e81526041602082015260829181019190915260aa606082015261016360808201526102c660a082015261058760c08201526106e560e08201526200013290600590600862000260565b50604080516080810182527386f7e2ef599690b64f0063b3f978ea6ae2814f638152737d6c70b6561c31935e6b0dd77731fc63d5ac37f260208201527319dcb402162b6937a8aceac87ed6c05219c9bef7918101919091527331bff88c6124e1622f81b3ba7ed219e5d78abd986060820152620001b4906008906004620002a4565b50348015620001c257600080fd5b50600080546001600160a01b0319163390811782556040519091907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a362000313565b8280548282559060005260206000209081019282156200024e579160200282015b828111156200024e578251829063ffffffff1690559160200191906001019062000229565b506200025c929150620002fc565b5090565b8280548282559060005260206000209081019282156200024e579160200282015b828111156200024e578251829061ffff1690559160200191906001019062000281565b8280548282559060005260206000209081019282156200024e579160200282015b828111156200024e57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620002c5565b5b808211156200025c5760008155600101620002fd565b611ae280620003236000396000f3fe608060405234801561001057600080fd5b50600436106101cf5760003560e01c8063715018a611610104578063bedb86fb116100a2578063d8f29cb511610071578063d8f29cb514610430578063e79b9e2114610443578063f2fde38b1461048c578063ff0938a71461049f57600080fd5b8063bedb86fb146103ee578063bf3c35c314610401578063c778e19214610414578063d8d8a0d71461042757600080fd5b80638943ec02116100de5780638943ec02146103755780638da5cb5b146103a15780638f32d59b146103b25780639accab55146103d157600080fd5b8063715018a61461034a578063716196f71461035257806384daaf541461036d57600080fd5b806327614ec41161017157806331b2e6c41161014b57806331b2e6c4146103005780635d799f87146103135780635eb325eb146103265780637028768f1461034157600080fd5b806327614ec4146102745780632da49d16146102875780632e4a90cb1461029057600080fd5b80631109b19a116101ad5780631109b19a1461022e5780631167186e1461024157806317aeb5f71461025457806318264f331461026957600080fd5b8063038ad000146101d457806306040618146102045780630a352b991461021b575b600080fd5b6001546101e7906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61020d600a5481565b6040519081526020016101fb565b61020d6102293660046115aa565b6104b3565b6101e761023c3660046115aa565b6104d4565b61020d61024f3660046115aa565b6104fe565b6102676102623660046115c3565b61050e565b005b61020d6365badf0081565b61020d6102823660046115aa565b610694565b61020d60065481565b6102d461029e36600461160a565b6009602052600090815260409020546001600160701b0380821691600160701b810490911690600160e01b900463ffffffff1683565b604080516001600160701b03948516815293909216602084015263ffffffff16908201526060016101fb565b61026761030e36600461162e565b6106a4565b6102676103213660046116a3565b6106f2565b6101e7731eaa43544daa399b87eecfcc6fa579d5ea4a618781565b61020d60025481565b6102676107f2565b6101e773346984a5a13241daf2587571ce7d86cea77bfb7e81565b610267610866565b610388610383366004611723565b610871565b6040516001600160e01b031990911681526020016101fb565b6000546001600160a01b03166101e7565b6000546001600160a01b031633145b60405190151581526020016101fb565b6103d96108af565b604080519283526020830191909152016101fb565b6102676103fc3660046117e2565b61096f565b61026761040f3660046115aa565b6109b7565b61026761042236600461160a565b610a43565b61020d60075481565b61026761043e36600461160a565b611024565b61045661045136600461160a565b611070565b6040805182516001600160701b039081168252602080850151909116908201529181015163ffffffff16908201526060016101fb565b61026761049a36600461160a565b6111c9565b6001546103c190600160a01b900460ff1681565b600481815481106104c357600080fd5b600091825260209091200154905081565b600881815481106104e457600080fd5b6000918252602090912001546001600160a01b0316905081565b600581815481106104c357600080fd5b6000546001600160a01b031633146105415760405162461bcd60e51b8152600401610538906117ff565b60405180910390fd5b6003548410156105b457826003858154811061055f5761055f611822565b9060005260206000200181905550816004858154811061058157610581611822565b906000526020600020018190555080600585815481106105a3576105a3611822565b600091825260209091200155610646565b6003805460018181019092557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01849055600480548083019091557f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018390556005805491820181556000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0018190555b6040805185815260208101859052908101839052606081018290527f132ea6b97a4eea2a5d619f7617dd4282377e3c165fa1f801fc5e26bb977519999060800160405180910390a150505050565b600381815481106104c357600080fd5b8060005b818110156106ec576106da8484838181106106c5576106c5611822565b9050602002016020810190610422919061160a565b806106e48161184e565b9150506106a8565b50505050565b6000546001600160a01b0316331461071c5760405162461bcd60e51b8152600401610538906117ff565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015610763573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107879190611867565b60405163a9059cbb60e01b81526001600160a01b038481166004830152602482018390529192509084169063a9059cbb90604401600060405180830381600087803b1580156107d557600080fd5b505af11580156107e9573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b0316331461081c5760405162461bcd60e51b8152600401610538906117ff565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b61086f33610a43565b565b60405162461bcd60e51b815260206004820152601060248201526f27379029b7bc9026b4b3b930ba34b7b760811b6044820152600090606401610538565b6000806365badf004210156108c75750600091829150565b600a546003546000906108dc90600190611880565b90505b42600383815481106108f3576108f3611822565b90600052602060002001541015610929578082106109175750600093849350915050565b816109218161184e565b9250506108df565b6004828154811061093c5761093c611822565b906000526020600020015493506005828154811061095c5761095c611822565b9060005260206000200154925050509091565b6000546001600160a01b031633146109995760405162461bcd60e51b8152600401610538906117ff565b60018054911515600160a01b0260ff60a01b19909216919091179055565b60405163079cc67960e41b815233600482015260248101829052731eaa43544daa399b87eecfcc6fa579d5ea4a6187906379cc6790906044016020604051808303816000875af1158015610a0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a339190611899565b50610a40338260006111fc565b50565b6365badf00421015610a975760405162461bcd60e51b815260206004820152601c60248201527f4d6967726174696f6e206973206e6f74207374617274656420796574000000006044820152606401610538565b600154600160a01b900460ff1615610ae75760405162461bcd60e51b8152602060048201526013602482015272135a59dc985d1a5bdb881a5cc81c185d5cd959606a1b6044820152606401610538565b600354600090610af990600190611880565b90505b426003600a5481548110610b1257610b12611822565b90600052602060002001541015610b835780600a5410610b695760405162461bcd60e51b8152602060048201526012602482015271135a59dc985d1a5bdb88199a5b9a5cda195960721b6044820152606401610538565b600a8054906000610b798361184e565b9190505550610afc565b6001600160a01b038216600090815260096020526040902054600160e01b900463ffffffff1615610be95760405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481b5a59dc985d195960821b6044820152606401610538565b60405163e79b9e2160e01b81526001600160a01b0383166004820152600090819073346984a5a13241daf2587571ce7d86cea77bfb7e9063e79b9e2190602401606060405180830381865afa158015610c46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6a91906118e1565b9050806040015163ffffffff16600003610e775760005b6004811015610d3c57600060088281548110610c9f57610c9f611822565b6000918252602090912001546040516320b93b6960e21b81526001600160a01b038881166004830152909116906382e4eda49060240161010060405180830381865afa158015610cf3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d179190611965565b8051909150610d269085611a22565b9350508080610d349061184e565b915050610c81565b506040518060600160405280836001600160701b0316815260200160006001600160701b031681526020016004600a5481548110610d7c57610d7c611822565b600091825260208083209091015463ffffffff9081169093526001600160a01b03881682526009815260409182902084518154928601519590930151909316600160e01b026001600160e01b036001600160701b03958616600160701b026001600160e01b031990931695909316949094171716919091179055610e02848360016111fc565b7f17bd98d373ca29f15c4088751e90d4b6ab74d72e75b677238ac452c8ab20dbe3846004600a5481548110610e3957610e39611822565b600091825260208083209190910154604080516001600160a01b039095168552918401528201859052606082015260800160405180910390a16106ec565b60208101516001600160701b031615610fe95780516020820151610e9b9190611a35565b604080516060810182526001600160701b0392831680825260006020808401828152878601805163ffffffff9081168789019081526001600160a01b038e1686526009855297852096518754935198518216600160e01b026001600160e01b03998b16600160701b026001600160e01b031990951691909a16179290921796909616969096179093559251918501519095509192610f3b92911690611a72565b602080840151604080516001600160a01b038a1681526001600160701b039283169381019390935292169181018290529091507f69ad942cd0be186fc035367df354cdda64c5048503ac199f931f2def922b3d3e9060600160405180910390a181602001516001600160701b031660076000828254610fba9190611a22565b925050819055508060026000828254610fd39190611a22565b90915550610fe39050858261148f565b506106ec565b60405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481b5a59dc985d195960821b6044820152606401610538565b6000546001600160a01b0316331461104e5760405162461bcd60e51b8152600401610538906117ff565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60408051606081018252600080825260208201819052918101919091526001600160a01b038216600090815260096020526040812054600160e01b900463ffffffff16900361116a5760405163e79b9e2160e01b81526001600160a01b038316600482015260009073346984a5a13241daf2587571ce7d86cea77bfb7e9063e79b9e2190602401606060405180830381865afa158015611114573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113891906118e1565b80516001600160701b0390811684526020808301519091169084015260409081015163ffffffff169083015250919050565b506001600160a01b0316600090815260096020908152604091829020825160608101845290546001600160701b038082168352600160701b82041692820192909252600160e01b90910463ffffffff169181019190915290565b919050565b6000546001600160a01b031633146111f35760405162461bcd60e51b8152600401610538906117ff565b610a40816114f9565b6365badf004210156112505760405162461bcd60e51b815260206004820152601c60248201527f4d6967726174696f6e206973206e6f74207374617274656420796574000000006044820152606401610538565b600154600160a01b900460ff16156112a05760405162461bcd60e51b8152602060048201526013602482015272135a59dc985d1a5bdb881a5cc81c185d5cd959606a1b6044820152606401610538565b6003546000906112b290600190611880565b90505b426003600a54815481106112cb576112cb611822565b9060005260206000200154101561133c5780600a54106113225760405162461bcd60e51b8152602060048201526012602482015271135a59dc985d1a5bdb88199a5b9a5cda195960721b6044820152606401610538565b600a80549060006113328361184e565b91905055506112b5565b600082156113d7576004600a548154811061135957611359611822565b90600052602060002001548461136f9190611a98565b905083600760008282546113839190611a22565b9091555050604080516001600160a01b0387168152602081018690529081018290527fd44a6dd2bfac4f6bc02d116d96aa12c24e8580626b95cb6a2f543f18cb61bd4c9060600160405180910390a1611466565b6005600a54815481106113ec576113ec611822565b9060005260206000200154846114029190611a98565b905083600660008282546114169190611a22565b9091555050604080516001600160a01b0387168152602081018690529081018290527f360e9013a4321fcce6c9385c1811b27dedd609caddbba8e813e7e5c1d4a6507b9060600160405180910390a15b80600260008282546114789190611a22565b909155506114889050858261148f565b5050505050565b6001546040516386ce028560e01b81526001600160a01b03848116600483015260248201849052909116906386ce028590604401600060405180830381600087803b1580156114dd57600080fd5b505af11580156114f1573d6000803e3d6000fd5b505050505050565b6001600160a01b03811661154f5760405162461bcd60e51b815260206004820152601860248201527f5a65726f2061646472657373206e6f7420616c6c6f77656400000000000000006044820152606401610538565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000602082840312156115bc57600080fd5b5035919050565b600080600080608085870312156115d957600080fd5b5050823594602084013594506040840135936060013592509050565b6001600160a01b0381168114610a4057600080fd5b60006020828403121561161c57600080fd5b8135611627816115f5565b9392505050565b6000806020838503121561164157600080fd5b823567ffffffffffffffff8082111561165957600080fd5b818501915085601f83011261166d57600080fd5b81358181111561167c57600080fd5b8660208260051b850101111561169157600080fd5b60209290920196919550909350505050565b600080604083850312156116b657600080fd5b82356116c1816115f5565b915060208301356116d1816115f5565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561171b5761171b6116dc565b604052919050565b60008060006060848603121561173857600080fd5b8335611743816115f5565b92506020848101359250604085013567ffffffffffffffff8082111561176857600080fd5b818701915087601f83011261177c57600080fd5b81358181111561178e5761178e6116dc565b6117a0601f8201601f191685016116f2565b915080825288848285010111156117b657600080fd5b80848401858401376000848284010152508093505050509250925092565b8015158114610a4057600080fd5b6000602082840312156117f457600080fd5b8135611627816117d4565b6020808252600990820152682737ba1027bbb732b960b91b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161186057611860611838565b5060010190565b60006020828403121561187957600080fd5b5051919050565b8181038181111561189357611893611838565b92915050565b6000602082840312156118ab57600080fd5b8151611627816117d4565b80516001600160701b03811681146111c457600080fd5b805163ffffffff811681146111c457600080fd5b6000606082840312156118f357600080fd5b6040516060810181811067ffffffffffffffff82111715611916576119166116dc565b604052611922836118b6565b8152611930602084016118b6565b6020820152611941604084016118cd565b60408201529392505050565b805167ffffffffffffffff811681146111c457600080fd5b600061010080838503121561197957600080fd5b6040519081019067ffffffffffffffff8211818310171561199c5761199c6116dc565b8160405283518152602084015160208201526119ba6040850161194d565b60408201526119cb6060850161194d565b60608201526119dc6080850161194d565b60808201526119ed60a085016118cd565b60a08201526119fe60c085016118cd565b60c082015260e08401519150611a13826115f5565b60e08101919091529392505050565b8082018082111561189357611893611838565b6001600160701b03818116838216019080821115611a5557611a55611838565b5092915050565b634e487b7160e01b600052601260045260246000fd5b60006001600160701b0380841680611a8c57611a8c611a5c565b92169190910492915050565b600082611aa757611aa7611a5c565b50049056fea2646970667358221220c4b2d31a51c6f799c693e31ac9e3ab61809b0008ef4bba2adfb91d02e41d1d2e64736f6c63430008130033
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c8063715018a611610104578063bedb86fb116100a2578063d8f29cb511610071578063d8f29cb514610430578063e79b9e2114610443578063f2fde38b1461048c578063ff0938a71461049f57600080fd5b8063bedb86fb146103ee578063bf3c35c314610401578063c778e19214610414578063d8d8a0d71461042757600080fd5b80638943ec02116100de5780638943ec02146103755780638da5cb5b146103a15780638f32d59b146103b25780639accab55146103d157600080fd5b8063715018a61461034a578063716196f71461035257806384daaf541461036d57600080fd5b806327614ec41161017157806331b2e6c41161014b57806331b2e6c4146103005780635d799f87146103135780635eb325eb146103265780637028768f1461034157600080fd5b806327614ec4146102745780632da49d16146102875780632e4a90cb1461029057600080fd5b80631109b19a116101ad5780631109b19a1461022e5780631167186e1461024157806317aeb5f71461025457806318264f331461026957600080fd5b8063038ad000146101d457806306040618146102045780630a352b991461021b575b600080fd5b6001546101e7906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61020d600a5481565b6040519081526020016101fb565b61020d6102293660046115aa565b6104b3565b6101e761023c3660046115aa565b6104d4565b61020d61024f3660046115aa565b6104fe565b6102676102623660046115c3565b61050e565b005b61020d6365badf0081565b61020d6102823660046115aa565b610694565b61020d60065481565b6102d461029e36600461160a565b6009602052600090815260409020546001600160701b0380821691600160701b810490911690600160e01b900463ffffffff1683565b604080516001600160701b03948516815293909216602084015263ffffffff16908201526060016101fb565b61026761030e36600461162e565b6106a4565b6102676103213660046116a3565b6106f2565b6101e7731eaa43544daa399b87eecfcc6fa579d5ea4a618781565b61020d60025481565b6102676107f2565b6101e773346984a5a13241daf2587571ce7d86cea77bfb7e81565b610267610866565b610388610383366004611723565b610871565b6040516001600160e01b031990911681526020016101fb565b6000546001600160a01b03166101e7565b6000546001600160a01b031633145b60405190151581526020016101fb565b6103d96108af565b604080519283526020830191909152016101fb565b6102676103fc3660046117e2565b61096f565b61026761040f3660046115aa565b6109b7565b61026761042236600461160a565b610a43565b61020d60075481565b61026761043e36600461160a565b611024565b61045661045136600461160a565b611070565b6040805182516001600160701b039081168252602080850151909116908201529181015163ffffffff16908201526060016101fb565b61026761049a36600461160a565b6111c9565b6001546103c190600160a01b900460ff1681565b600481815481106104c357600080fd5b600091825260209091200154905081565b600881815481106104e457600080fd5b6000918252602090912001546001600160a01b0316905081565b600581815481106104c357600080fd5b6000546001600160a01b031633146105415760405162461bcd60e51b8152600401610538906117ff565b60405180910390fd5b6003548410156105b457826003858154811061055f5761055f611822565b9060005260206000200181905550816004858154811061058157610581611822565b906000526020600020018190555080600585815481106105a3576105a3611822565b600091825260209091200155610646565b6003805460018181019092557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01849055600480548083019091557f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018390556005805491820181556000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0018190555b6040805185815260208101859052908101839052606081018290527f132ea6b97a4eea2a5d619f7617dd4282377e3c165fa1f801fc5e26bb977519999060800160405180910390a150505050565b600381815481106104c357600080fd5b8060005b818110156106ec576106da8484838181106106c5576106c5611822565b9050602002016020810190610422919061160a565b806106e48161184e565b9150506106a8565b50505050565b6000546001600160a01b0316331461071c5760405162461bcd60e51b8152600401610538906117ff565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015610763573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107879190611867565b60405163a9059cbb60e01b81526001600160a01b038481166004830152602482018390529192509084169063a9059cbb90604401600060405180830381600087803b1580156107d557600080fd5b505af11580156107e9573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b0316331461081c5760405162461bcd60e51b8152600401610538906117ff565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b61086f33610a43565b565b60405162461bcd60e51b815260206004820152601060248201526f27379029b7bc9026b4b3b930ba34b7b760811b6044820152600090606401610538565b6000806365badf004210156108c75750600091829150565b600a546003546000906108dc90600190611880565b90505b42600383815481106108f3576108f3611822565b90600052602060002001541015610929578082106109175750600093849350915050565b816109218161184e565b9250506108df565b6004828154811061093c5761093c611822565b906000526020600020015493506005828154811061095c5761095c611822565b9060005260206000200154925050509091565b6000546001600160a01b031633146109995760405162461bcd60e51b8152600401610538906117ff565b60018054911515600160a01b0260ff60a01b19909216919091179055565b60405163079cc67960e41b815233600482015260248101829052731eaa43544daa399b87eecfcc6fa579d5ea4a6187906379cc6790906044016020604051808303816000875af1158015610a0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a339190611899565b50610a40338260006111fc565b50565b6365badf00421015610a975760405162461bcd60e51b815260206004820152601c60248201527f4d6967726174696f6e206973206e6f74207374617274656420796574000000006044820152606401610538565b600154600160a01b900460ff1615610ae75760405162461bcd60e51b8152602060048201526013602482015272135a59dc985d1a5bdb881a5cc81c185d5cd959606a1b6044820152606401610538565b600354600090610af990600190611880565b90505b426003600a5481548110610b1257610b12611822565b90600052602060002001541015610b835780600a5410610b695760405162461bcd60e51b8152602060048201526012602482015271135a59dc985d1a5bdb88199a5b9a5cda195960721b6044820152606401610538565b600a8054906000610b798361184e565b9190505550610afc565b6001600160a01b038216600090815260096020526040902054600160e01b900463ffffffff1615610be95760405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481b5a59dc985d195960821b6044820152606401610538565b60405163e79b9e2160e01b81526001600160a01b0383166004820152600090819073346984a5a13241daf2587571ce7d86cea77bfb7e9063e79b9e2190602401606060405180830381865afa158015610c46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6a91906118e1565b9050806040015163ffffffff16600003610e775760005b6004811015610d3c57600060088281548110610c9f57610c9f611822565b6000918252602090912001546040516320b93b6960e21b81526001600160a01b038881166004830152909116906382e4eda49060240161010060405180830381865afa158015610cf3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d179190611965565b8051909150610d269085611a22565b9350508080610d349061184e565b915050610c81565b506040518060600160405280836001600160701b0316815260200160006001600160701b031681526020016004600a5481548110610d7c57610d7c611822565b600091825260208083209091015463ffffffff9081169093526001600160a01b03881682526009815260409182902084518154928601519590930151909316600160e01b026001600160e01b036001600160701b03958616600160701b026001600160e01b031990931695909316949094171716919091179055610e02848360016111fc565b7f17bd98d373ca29f15c4088751e90d4b6ab74d72e75b677238ac452c8ab20dbe3846004600a5481548110610e3957610e39611822565b600091825260208083209190910154604080516001600160a01b039095168552918401528201859052606082015260800160405180910390a16106ec565b60208101516001600160701b031615610fe95780516020820151610e9b9190611a35565b604080516060810182526001600160701b0392831680825260006020808401828152878601805163ffffffff9081168789019081526001600160a01b038e1686526009855297852096518754935198518216600160e01b026001600160e01b03998b16600160701b026001600160e01b031990951691909a16179290921796909616969096179093559251918501519095509192610f3b92911690611a72565b602080840151604080516001600160a01b038a1681526001600160701b039283169381019390935292169181018290529091507f69ad942cd0be186fc035367df354cdda64c5048503ac199f931f2def922b3d3e9060600160405180910390a181602001516001600160701b031660076000828254610fba9190611a22565b925050819055508060026000828254610fd39190611a22565b90915550610fe39050858261148f565b506106ec565b60405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481b5a59dc985d195960821b6044820152606401610538565b6000546001600160a01b0316331461104e5760405162461bcd60e51b8152600401610538906117ff565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60408051606081018252600080825260208201819052918101919091526001600160a01b038216600090815260096020526040812054600160e01b900463ffffffff16900361116a5760405163e79b9e2160e01b81526001600160a01b038316600482015260009073346984a5a13241daf2587571ce7d86cea77bfb7e9063e79b9e2190602401606060405180830381865afa158015611114573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113891906118e1565b80516001600160701b0390811684526020808301519091169084015260409081015163ffffffff169083015250919050565b506001600160a01b0316600090815260096020908152604091829020825160608101845290546001600160701b038082168352600160701b82041692820192909252600160e01b90910463ffffffff169181019190915290565b919050565b6000546001600160a01b031633146111f35760405162461bcd60e51b8152600401610538906117ff565b610a40816114f9565b6365badf004210156112505760405162461bcd60e51b815260206004820152601c60248201527f4d6967726174696f6e206973206e6f74207374617274656420796574000000006044820152606401610538565b600154600160a01b900460ff16156112a05760405162461bcd60e51b8152602060048201526013602482015272135a59dc985d1a5bdb881a5cc81c185d5cd959606a1b6044820152606401610538565b6003546000906112b290600190611880565b90505b426003600a54815481106112cb576112cb611822565b9060005260206000200154101561133c5780600a54106113225760405162461bcd60e51b8152602060048201526012602482015271135a59dc985d1a5bdb88199a5b9a5cda195960721b6044820152606401610538565b600a80549060006113328361184e565b91905055506112b5565b600082156113d7576004600a548154811061135957611359611822565b90600052602060002001548461136f9190611a98565b905083600760008282546113839190611a22565b9091555050604080516001600160a01b0387168152602081018690529081018290527fd44a6dd2bfac4f6bc02d116d96aa12c24e8580626b95cb6a2f543f18cb61bd4c9060600160405180910390a1611466565b6005600a54815481106113ec576113ec611822565b9060005260206000200154846114029190611a98565b905083600660008282546114169190611a22565b9091555050604080516001600160a01b0387168152602081018690529081018290527f360e9013a4321fcce6c9385c1811b27dedd609caddbba8e813e7e5c1d4a6507b9060600160405180910390a15b80600260008282546114789190611a22565b909155506114889050858261148f565b5050505050565b6001546040516386ce028560e01b81526001600160a01b03848116600483015260248201849052909116906386ce028590604401600060405180830381600087803b1580156114dd57600080fd5b505af11580156114f1573d6000803e3d6000fd5b505050505050565b6001600160a01b03811661154f5760405162461bcd60e51b815260206004820152601860248201527f5a65726f2061646472657373206e6f7420616c6c6f77656400000000000000006044820152606401610538565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000602082840312156115bc57600080fd5b5035919050565b600080600080608085870312156115d957600080fd5b5050823594602084013594506040840135936060013592509050565b6001600160a01b0381168114610a4057600080fd5b60006020828403121561161c57600080fd5b8135611627816115f5565b9392505050565b6000806020838503121561164157600080fd5b823567ffffffffffffffff8082111561165957600080fd5b818501915085601f83011261166d57600080fd5b81358181111561167c57600080fd5b8660208260051b850101111561169157600080fd5b60209290920196919550909350505050565b600080604083850312156116b657600080fd5b82356116c1816115f5565b915060208301356116d1816115f5565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561171b5761171b6116dc565b604052919050565b60008060006060848603121561173857600080fd5b8335611743816115f5565b92506020848101359250604085013567ffffffffffffffff8082111561176857600080fd5b818701915087601f83011261177c57600080fd5b81358181111561178e5761178e6116dc565b6117a0601f8201601f191685016116f2565b915080825288848285010111156117b657600080fd5b80848401858401376000848284010152508093505050509250925092565b8015158114610a4057600080fd5b6000602082840312156117f457600080fd5b8135611627816117d4565b6020808252600990820152682737ba1027bbb732b960b91b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161186057611860611838565b5060010190565b60006020828403121561187957600080fd5b5051919050565b8181038181111561189357611893611838565b92915050565b6000602082840312156118ab57600080fd5b8151611627816117d4565b80516001600160701b03811681146111c457600080fd5b805163ffffffff811681146111c457600080fd5b6000606082840312156118f357600080fd5b6040516060810181811067ffffffffffffffff82111715611916576119166116dc565b604052611922836118b6565b8152611930602084016118b6565b6020820152611941604084016118cd565b60408201529392505050565b805167ffffffffffffffff811681146111c457600080fd5b600061010080838503121561197957600080fd5b6040519081019067ffffffffffffffff8211818310171561199c5761199c6116dc565b8160405283518152602084015160208201526119ba6040850161194d565b60408201526119cb6060850161194d565b60608201526119dc6080850161194d565b60808201526119ed60a085016118cd565b60a08201526119fe60c085016118cd565b60c082015260e08401519150611a13826115f5565b60e08101919091529392505050565b8082018082111561189357611893611838565b6001600160701b03818116838216019080821115611a5557611a55611838565b5092915050565b634e487b7160e01b600052601260045260246000fd5b60006001600160701b0380841680611a8c57611a8c611a5c565b92169190910492915050565b600082611aa757611aa7611a5c565b50049056fea2646970667358221220c4b2d31a51c6f799c693e31ac9e3ab61809b0008ef4bba2adfb91d02e41d1d2e64736f6c63430008130033