Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- Migration
- Optimization enabled
- true
- Compiler version
- v0.8.19+commit.7dd6d404
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2024-09-26T15:32:56.006700Z
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 returns (bool);
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);
}
contract Migration is Ownable {
address constant public SOY = address(0xE1A77164e5C6d9E0fc0b23D11e0874De6B328e68); //address(0x9FaE2529863bD691B4A7171bDfCf33C7ebB10a65);
address constant public CLOE = address(0xd29588B55c9aCfEe50f52600Ae7C6a251cd9b145); //address(0x1eAa43544dAa399b87EEcFcC6Fa579D5ea4A6187);
uint256 constant public startMigration = 1705786025; //1706745600; // timestamp when migration start 1 February 2024 00:00:00 UTC
bool public isPause;
uint256 public totalSlothMinted;
uint256[] public periodEnd = [1705881599,1705967999,1706054399,1706054499,1706054599,1706054699,1706054799,1706054899,1706745599]; // for test
//uint256[] public periodEnd = [1706831999,1706918399,1707004799,1707091199,1707177599,1707263999,1707868799,1708473599,1714521599]; // last period will ends on 30 April 2024 23:59:59 UTC
uint256[] public soyRatio = [100,200,400,800,1000,2000,4000,8000,10000];
uint256[] public cloeRatio = [80,160,320,640,800,1600,3200,6400,8000];
uint256 public totalCLOEMigrated;
struct StakeRate {
uint112 migratedAmount;
uint112 reservedAmount;
uint32 rate;
}
address[] public stakingContracts = [0x86F7e2ef599690b64f0063b3F978ea6Ae2814f63,0x7d6C70b6561C31935e6B0dd77731FC63D5aC37F2,0x19DcB402162b6937a8ACEac87Ed6c05219c9bEf7,0x31bFf88C6124E1622f81b3Ba7ED219e5d78abd98];
mapping(address user => StakeRate) public stakingRateReserved;
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");
while(periodEnd[currentPeriod] < block.timestamp) {
require(currentPeriod < 8, "Migration finished"); // 8 - last period
currentPeriod++;
}
_;
}
function gatRates() external view returns(uint256 rateSOY, uint256 rateCLOE) {
if(block.timestamp < startMigration) return (0,0);
uint256 current = currentPeriod;
while(periodEnd[current] < block.timestamp) {
if(currentPeriod >= 8) return (0,0); // 8 - last period
current++;
}
rateSOY = soyRatio[current];
rateCLOE = cloeRatio[current];
}
function tokenReceived(address _from, uint _value, bytes memory data) external returns(bytes4) {
require(msg.sender == SOY, "Only SOY");
if (keccak256(data) == keccak256("stakingFixRateMigration"))
stakingFixRateMigration(_from, _value);
else
migrate(_from, _value, true);
return this.tokenReceived.selector;
}
function migrateCLOE(uint256 amount) external {
IERC223(CLOE).burnFrom(msg.sender, amount);
totalCLOEMigrated += amount;
migrate(msg.sender, amount, false);
}
function migrate(address user, uint256 amount, bool isSoy) internal migrationAllowed {
uint256 slothAmount;
if(isSoy) {
slothAmount = amount / soyRatio[currentPeriod];
emit Migrate(user, amount, slothAmount);
} else {
slothAmount = amount / cloeRatio[currentPeriod];
emit MigrateCLOE(user, amount, slothAmount);
}
totalSlothMinted += slothAmount;
transferToVesting(user, slothAmount);
}
function stakingMigrate() external migrationAllowed {
require(stakingRateReserved[msg.sender].rate == 0, "Already migrated");
uint256 endMigration = periodEnd[8]; // 30 April 2024 23:59:59 UTC
uint256 migratedAmount;
uint256 reservedAmount;
for (uint i; i<4; i++) {
IStacking.Staker memory s = IStacking(stakingContracts[i]).staker(msg.sender);
if(s.endTime > endMigration || (s.endTime == 0 && i != 0)) migratedAmount += s.amount; // release time after and of migration and it's not a 30 days staking
else reservedAmount += s.amount;
}
stakingRateReserved[msg.sender] = StakeRate(uint112(migratedAmount),uint112(reservedAmount),uint32(soyRatio[currentPeriod]));
migrate(msg.sender, migratedAmount, true);
emit StakingMigrate(msg.sender, soyRatio[currentPeriod], migratedAmount, reservedAmount);
}
function stakingFixRateMigration(address user, uint256 amount) internal {
uint256 reservedAmount = stakingRateReserved[user].reservedAmount;
require(reservedAmount >= amount, "Exceed reserved amount");
uint256 slothAmount = amount / stakingRateReserved[user].rate;
stakingRateReserved[user].reservedAmount = uint112(reservedAmount - amount);
emit StakingFixRateMigration(user, amount, slothAmount);
totalSlothMinted += slothAmount;
transferToVesting(user, slothAmount);
}
function transferToVesting(address user, uint256 amount) internal {
IERC223(0x7873d09AF3d6965988831C60c7D38DBbd2eAEAB0).mint(user, amount); // for testing
}
function setPause(bool pause) external onlyOwner {
isPause = pause;
}
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 {
require(token != SOY, "wrong token");
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":"address"}],"name":"SOY","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":"gatRates","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":"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":"view","outputs":[{"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":"uint256","name":"","internalType":"uint256"}],"name":"startMigration","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes4","name":"","internalType":"bytes4"}],"name":"tokenReceived","inputs":[{"type":"address","name":"_from","internalType":"address"},{"type":"uint256","name":"_value","internalType":"uint256"},{"type":"bytes","name":"data","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":"totalSlothMinted","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
Contract Creation Code
0x6101a06040526365adafff60809081526365af017f60a0526365b052ff60c0526365b0536360e0526365b053c7610100526365b0542b610120526365b0548f610140526365b054f3610160526365badeff610180526200006490600290600962000202565b5060408051610120810182526064815260c860208201526101909181019190915261032060608201526103e860808201526107d060a0820152610fa060c0820152611f4060e0820152612710610100820152620000c69060039060096200025a565b5060408051610120810182526050815260a060208201819052610140928201929092526102806060820152610320608082015261064091810191909152610c8060c082015261190060e0820152611f406101008201526200012c9060049060096200025a565b50604080516080810182527386f7e2ef599690b64f0063b3f978ea6ae2814f638152737d6c70b6561c31935e6b0dd77731fc63d5ac37f260208201527319dcb402162b6937a8aceac87ed6c05219c9bef7918101919091527331bff88c6124e1622f81b3ba7ed219e5d78abd986060820152620001ae9060069060046200029e565b50348015620001bc57600080fd5b50600080546001600160a01b0319163390811782556040519091907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a36200030d565b82805482825590600052602060002090810192821562000248579160200282015b8281111562000248578251829063ffffffff1690559160200191906001019062000223565b5062000256929150620002f6565b5090565b82805482825590600052602060002090810192821562000248579160200282015b8281111562000248578251829061ffff169055916020019190600101906200027b565b82805482825590600052602060002090810192821562000248579160200282015b828111156200024857825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620002bf565b5b80821115620002565760008155600101620002f7565b61165e806200031d6000396000f3fe608060405234801561001057600080fd5b506004361061014d5760003560e01c8063715018a6116100c3578063be9e2c9a1161007c578063be9e2c9a146102bb578063bedb86fb146102d6578063bf3c35c3146102e9578063e79b9e21146102fc578063f2fde38b1461036c578063ff0938a71461037f57600080fd5b8063715018a614610232578063828ee7bc1461023a57806384daaf54146102575780638943ec021461025f5780638da5cb5b1461028b5780638f32d59b1461029c57600080fd5b806318264f331161011557806318264f33146101d457806327614ec4146101df5780632da49d16146101f25780635d799f87146101fb5780635eb325eb1461020e5780637028768f1461022957600080fd5b806306040618146101525780630a352b991461016e5780631109b19a146101815780631167186e146101ac57806317aeb5f7146101bf575b600080fd5b61015b60085481565b6040519081526020015b60405180910390f35b61015b61017c36600461126e565b610393565b61019461018f36600461126e565b6103b4565b6040516001600160a01b039091168152602001610165565b61015b6101ba36600461126e565b6103de565b6101d26101cd366004611287565b6103ee565b005b61015b6365ac3aa981565b61015b6101ed36600461126e565b610574565b61015b60055481565b6101d26102093660046112ce565b610584565b61019473d29588b55c9acfee50f52600ae7c6a251cd9b14581565b61015b60015481565b6101d26106f1565b610242610765565b60408051928352602083019190915201610165565b6101d2610811565b61027261026d36600461134e565b610bfc565b6040516001600160e01b03199091168152602001610165565b6000546001600160a01b0316610194565b6000546001600160a01b031633145b6040519015158152602001610165565b61019473e1a77164e5c6d9e0fc0b23d11e0874de6b328e6881565b6101d26102e436600461140d565b610ca4565b6101d26102f736600461126e565b610cec565b61034061030a366004611431565b6007602052600090815260409020546001600160701b0380821691600160701b810490911690600160e01b900463ffffffff1683565b604080516001600160701b03948516815293909216602084015263ffffffff1690820152606001610165565b6101d261037a366004611431565b610d90565b6000546102ab90600160a01b900460ff1681565b600381815481106103a357600080fd5b600091825260209091200154905081565b600681815481106103c457600080fd5b6000918252602090912001546001600160a01b0316905081565b600481815481106103a357600080fd5b6000546001600160a01b031633146104215760405162461bcd60e51b81526004016104189061144e565b60405180910390fd5b60025484101561049457826002858154811061043f5761043f611471565b9060005260206000200181905550816003858154811061046157610461611471565b9060005260206000200181905550806004858154811061048357610483611471565b600091825260209091200155610526565b6002805460018181019092557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01849055600380548083019091557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b018390556004805491820181556000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018190555b6040805185815260208101859052908101839052606081018290527f132ea6b97a4eea2a5d619f7617dd4282377e3c165fa1f801fc5e26bb977519999060800160405180910390a150505050565b600281815481106103a357600080fd5b6000546001600160a01b031633146105ae5760405162461bcd60e51b81526004016104189061144e565b73e1a77164e5c6d9e0fc0b23d11e0874de6b328e67196001600160a01b038316016106095760405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610418565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015610650573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106749190611487565b60405163a9059cbb60e01b81526001600160a01b038481166004830152602482018390529192509084169063a9059cbb906044016020604051808303816000875af11580156106c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106eb91906114a0565b50505050565b6000546001600160a01b0316331461071b5760405162461bcd60e51b81526004016104189061144e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000806365ac3aa942101561077d5750600091829150565b6008545b426002828154811061079557610795611471565b906000526020600020015410156107cc5760088054106107ba57506000928392509050565b806107c4816114d3565b915050610781565b600381815481106107df576107df611471565b90600052602060002001549250600481815481106107ff576107ff611471565b90600052602060002001549150509091565b6365ac3aa94210156108655760405162461bcd60e51b815260206004820152601c60248201527f4d6967726174696f6e206973206e6f74207374617274656420796574000000006044820152606401610418565b600054600160a01b900460ff16156108b55760405162461bcd60e51b8152602060048201526013602482015272135a59dc985d1a5bdb881a5cc81c185d5cd959606a1b6044820152606401610418565b426002600854815481106108cb576108cb611471565b9060005260206000200154101561093c5760088054106109225760405162461bcd60e51b8152602060048201526012602482015271135a59dc985d1a5bdb88199a5b9a5cda195960721b6044820152606401610418565b60088054906000610932836114d3565b91905055506108b5565b33600090815260076020526040902054600160e01b900463ffffffff16156109995760405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481b5a59dc985d195960821b6044820152606401610418565b600060026008815481106109af576109af611471565b9060005260206000200154905060008060005b6004811015610ac4576000600682815481106109e0576109e0611471565b6000918252602090912001546040516320b93b6960e21b81523360048201526001600160a01b03909116906382e4eda49060240161010060405180830381865afa158015610a32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a56919061151d565b905084816040015167ffffffffffffffff161180610a8a5750604081015167ffffffffffffffff16158015610a8a57508115155b15610aa2578051610a9b90856115da565b9350610ab1565b8051610aae90846115da565b92505b5080610abc816114d3565b9150506109c2565b506040518060600160405280836001600160701b03168152602001826001600160701b03168152602001600360085481548110610b0357610b03611471565b600091825260208083209091015463ffffffff908116909352338083526007825260409283902085518154938701519690940151909416600160e01b026001600160e01b036001600160701b03968716600160701b026001600160e01b031990941696909416959095179190911791909116929092179055610b8790836001610dc3565b7f17bd98d373ca29f15c4088751e90d4b6ab74d72e75b677238ac452c8ab20dbe333600360085481548110610bbe57610bbe611471565b60009182526020918290200154604080516001600160a01b0390941684529183015281018490526060810183905260800160405180910390a1505050565b60003373e1a77164e5c6d9e0fc0b23d11e0874de6b328e6814610c4c5760405162461bcd60e51b81526020600482015260086024820152674f6e6c7920534f5960c01b6044820152606401610418565b815160208301207fd62bf507207cbfed0be58152d90527386cb09b87448f61308aa066342be1f0f401610c8857610c83848461100f565b610c94565b610c9484846001610dc3565b506344a1f60160e11b9392505050565b6000546001600160a01b03163314610cce5760405162461bcd60e51b81526004016104189061144e565b60008054911515600160a01b0260ff60a01b19909216919091179055565b60405163079cc67960e41b81523360048201526024810182905273d29588b55c9acfee50f52600ae7c6a251cd9b145906379cc6790906044016020604051808303816000875af1158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906114a0565b508060056000828254610d7b91906115da565b90915550610d8d905033826000610dc3565b50565b6000546001600160a01b03163314610dba5760405162461bcd60e51b81526004016104189061144e565b610d8d81611145565b6365ac3aa9421015610e175760405162461bcd60e51b815260206004820152601c60248201527f4d6967726174696f6e206973206e6f74207374617274656420796574000000006044820152606401610418565b600054600160a01b900460ff1615610e675760405162461bcd60e51b8152602060048201526013602482015272135a59dc985d1a5bdb881a5cc81c185d5cd959606a1b6044820152606401610418565b42600260085481548110610e7d57610e7d611471565b90600052602060002001541015610eee576008805410610ed45760405162461bcd60e51b8152602060048201526012602482015271135a59dc985d1a5bdb88199a5b9a5cda195960721b6044820152606401610418565b60088054906000610ee4836114d3565b9190505550610e67565b60008115610f7357600360085481548110610f0b57610f0b611471565b906000526020600020015483610f2191906115f3565b604080516001600160a01b0387168152602081018690529081018290529091507fd44a6dd2bfac4f6bc02d116d96aa12c24e8580626b95cb6a2f543f18cb61bd4c9060600160405180910390a1610fed565b600460085481548110610f8857610f88611471565b906000526020600020015483610f9e91906115f3565b604080516001600160a01b0387168152602081018690529081018290529091507f360e9013a4321fcce6c9385c1811b27dedd609caddbba8e813e7e5c1d4a6507b906060015b60405180910390a15b8060016000828254610fff91906115da565b909155506106eb905084826111f6565b6001600160a01b038216600090815260076020526040902054600160701b90046001600160701b0316818110156110815760405162461bcd60e51b8152602060048201526016602482015275115e18d95959081c995cd95c9d995908185b5bdd5b9d60521b6044820152606401610418565b6001600160a01b0383166000908152600760205260408120546110b190600160e01b900463ffffffff16846115f3565b90506110bd8383611615565b6001600160a01b03851660008181526007602090815260409182902080546001600160701b0395909516600160701b026dffffffffffffffffffffffffffff60701b199095169490941790935580519182529181018590529081018290527f69ad942cd0be186fc035367df354cdda64c5048503ac199f931f2def922b3d3e90606001610fe4565b6001600160a01b03811661119b5760405162461bcd60e51b815260206004820152601860248201527f5a65726f2061646472657373206e6f7420616c6c6f77656400000000000000006044820152606401610418565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516340c10f1960e01b81526001600160a01b038316600482015260248101829052737873d09af3d6965988831c60c7d38dbbd2eaeab0906340c10f1990604401600060405180830381600087803b15801561125257600080fd5b505af1158015611266573d6000803e3d6000fd5b505050505050565b60006020828403121561128057600080fd5b5035919050565b6000806000806080858703121561129d57600080fd5b5050823594602084013594506040840135936060013592509050565b6001600160a01b0381168114610d8d57600080fd5b600080604083850312156112e157600080fd5b82356112ec816112b9565b915060208301356112fc816112b9565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561134657611346611307565b604052919050565b60008060006060848603121561136357600080fd5b833561136e816112b9565b92506020848101359250604085013567ffffffffffffffff8082111561139357600080fd5b818701915087601f8301126113a757600080fd5b8135818111156113b9576113b9611307565b6113cb601f8201601f1916850161131d565b915080825288848285010111156113e157600080fd5b80848401858401376000848284010152508093505050509250925092565b8015158114610d8d57600080fd5b60006020828403121561141f57600080fd5b813561142a816113ff565b9392505050565b60006020828403121561144357600080fd5b813561142a816112b9565b6020808252600990820152682737ba1027bbb732b960b91b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561149957600080fd5b5051919050565b6000602082840312156114b257600080fd5b815161142a816113ff565b634e487b7160e01b600052601160045260246000fd5b6000600182016114e5576114e56114bd565b5060010190565b805167ffffffffffffffff8116811461150457600080fd5b919050565b805163ffffffff8116811461150457600080fd5b600061010080838503121561153157600080fd5b6040519081019067ffffffffffffffff8211818310171561155457611554611307565b816040528351815260208401516020820152611572604085016114ec565b6040820152611583606085016114ec565b6060820152611594608085016114ec565b60808201526115a560a08501611509565b60a08201526115b660c08501611509565b60c082015260e084015191506115cb826112b9565b60e08101919091529392505050565b808201808211156115ed576115ed6114bd565b92915050565b60008261161057634e487b7160e01b600052601260045260246000fd5b500490565b818103818111156115ed576115ed6114bd56fea2646970667358221220b005022b4fb26ba2ecef9826459fe89bedb9f7df1d631b9590e8ee8fd837c28064736f6c63430008130033
Deployed ByteCode
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c8063715018a6116100c3578063be9e2c9a1161007c578063be9e2c9a146102bb578063bedb86fb146102d6578063bf3c35c3146102e9578063e79b9e21146102fc578063f2fde38b1461036c578063ff0938a71461037f57600080fd5b8063715018a614610232578063828ee7bc1461023a57806384daaf54146102575780638943ec021461025f5780638da5cb5b1461028b5780638f32d59b1461029c57600080fd5b806318264f331161011557806318264f33146101d457806327614ec4146101df5780632da49d16146101f25780635d799f87146101fb5780635eb325eb1461020e5780637028768f1461022957600080fd5b806306040618146101525780630a352b991461016e5780631109b19a146101815780631167186e146101ac57806317aeb5f7146101bf575b600080fd5b61015b60085481565b6040519081526020015b60405180910390f35b61015b61017c36600461126e565b610393565b61019461018f36600461126e565b6103b4565b6040516001600160a01b039091168152602001610165565b61015b6101ba36600461126e565b6103de565b6101d26101cd366004611287565b6103ee565b005b61015b6365ac3aa981565b61015b6101ed36600461126e565b610574565b61015b60055481565b6101d26102093660046112ce565b610584565b61019473d29588b55c9acfee50f52600ae7c6a251cd9b14581565b61015b60015481565b6101d26106f1565b610242610765565b60408051928352602083019190915201610165565b6101d2610811565b61027261026d36600461134e565b610bfc565b6040516001600160e01b03199091168152602001610165565b6000546001600160a01b0316610194565b6000546001600160a01b031633145b6040519015158152602001610165565b61019473e1a77164e5c6d9e0fc0b23d11e0874de6b328e6881565b6101d26102e436600461140d565b610ca4565b6101d26102f736600461126e565b610cec565b61034061030a366004611431565b6007602052600090815260409020546001600160701b0380821691600160701b810490911690600160e01b900463ffffffff1683565b604080516001600160701b03948516815293909216602084015263ffffffff1690820152606001610165565b6101d261037a366004611431565b610d90565b6000546102ab90600160a01b900460ff1681565b600381815481106103a357600080fd5b600091825260209091200154905081565b600681815481106103c457600080fd5b6000918252602090912001546001600160a01b0316905081565b600481815481106103a357600080fd5b6000546001600160a01b031633146104215760405162461bcd60e51b81526004016104189061144e565b60405180910390fd5b60025484101561049457826002858154811061043f5761043f611471565b9060005260206000200181905550816003858154811061046157610461611471565b9060005260206000200181905550806004858154811061048357610483611471565b600091825260209091200155610526565b6002805460018181019092557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01849055600380548083019091557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b018390556004805491820181556000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018190555b6040805185815260208101859052908101839052606081018290527f132ea6b97a4eea2a5d619f7617dd4282377e3c165fa1f801fc5e26bb977519999060800160405180910390a150505050565b600281815481106103a357600080fd5b6000546001600160a01b031633146105ae5760405162461bcd60e51b81526004016104189061144e565b73e1a77164e5c6d9e0fc0b23d11e0874de6b328e67196001600160a01b038316016106095760405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610418565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015610650573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106749190611487565b60405163a9059cbb60e01b81526001600160a01b038481166004830152602482018390529192509084169063a9059cbb906044016020604051808303816000875af11580156106c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106eb91906114a0565b50505050565b6000546001600160a01b0316331461071b5760405162461bcd60e51b81526004016104189061144e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000806365ac3aa942101561077d5750600091829150565b6008545b426002828154811061079557610795611471565b906000526020600020015410156107cc5760088054106107ba57506000928392509050565b806107c4816114d3565b915050610781565b600381815481106107df576107df611471565b90600052602060002001549250600481815481106107ff576107ff611471565b90600052602060002001549150509091565b6365ac3aa94210156108655760405162461bcd60e51b815260206004820152601c60248201527f4d6967726174696f6e206973206e6f74207374617274656420796574000000006044820152606401610418565b600054600160a01b900460ff16156108b55760405162461bcd60e51b8152602060048201526013602482015272135a59dc985d1a5bdb881a5cc81c185d5cd959606a1b6044820152606401610418565b426002600854815481106108cb576108cb611471565b9060005260206000200154101561093c5760088054106109225760405162461bcd60e51b8152602060048201526012602482015271135a59dc985d1a5bdb88199a5b9a5cda195960721b6044820152606401610418565b60088054906000610932836114d3565b91905055506108b5565b33600090815260076020526040902054600160e01b900463ffffffff16156109995760405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481b5a59dc985d195960821b6044820152606401610418565b600060026008815481106109af576109af611471565b9060005260206000200154905060008060005b6004811015610ac4576000600682815481106109e0576109e0611471565b6000918252602090912001546040516320b93b6960e21b81523360048201526001600160a01b03909116906382e4eda49060240161010060405180830381865afa158015610a32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a56919061151d565b905084816040015167ffffffffffffffff161180610a8a5750604081015167ffffffffffffffff16158015610a8a57508115155b15610aa2578051610a9b90856115da565b9350610ab1565b8051610aae90846115da565b92505b5080610abc816114d3565b9150506109c2565b506040518060600160405280836001600160701b03168152602001826001600160701b03168152602001600360085481548110610b0357610b03611471565b600091825260208083209091015463ffffffff908116909352338083526007825260409283902085518154938701519690940151909416600160e01b026001600160e01b036001600160701b03968716600160701b026001600160e01b031990941696909416959095179190911791909116929092179055610b8790836001610dc3565b7f17bd98d373ca29f15c4088751e90d4b6ab74d72e75b677238ac452c8ab20dbe333600360085481548110610bbe57610bbe611471565b60009182526020918290200154604080516001600160a01b0390941684529183015281018490526060810183905260800160405180910390a1505050565b60003373e1a77164e5c6d9e0fc0b23d11e0874de6b328e6814610c4c5760405162461bcd60e51b81526020600482015260086024820152674f6e6c7920534f5960c01b6044820152606401610418565b815160208301207fd62bf507207cbfed0be58152d90527386cb09b87448f61308aa066342be1f0f401610c8857610c83848461100f565b610c94565b610c9484846001610dc3565b506344a1f60160e11b9392505050565b6000546001600160a01b03163314610cce5760405162461bcd60e51b81526004016104189061144e565b60008054911515600160a01b0260ff60a01b19909216919091179055565b60405163079cc67960e41b81523360048201526024810182905273d29588b55c9acfee50f52600ae7c6a251cd9b145906379cc6790906044016020604051808303816000875af1158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906114a0565b508060056000828254610d7b91906115da565b90915550610d8d905033826000610dc3565b50565b6000546001600160a01b03163314610dba5760405162461bcd60e51b81526004016104189061144e565b610d8d81611145565b6365ac3aa9421015610e175760405162461bcd60e51b815260206004820152601c60248201527f4d6967726174696f6e206973206e6f74207374617274656420796574000000006044820152606401610418565b600054600160a01b900460ff1615610e675760405162461bcd60e51b8152602060048201526013602482015272135a59dc985d1a5bdb881a5cc81c185d5cd959606a1b6044820152606401610418565b42600260085481548110610e7d57610e7d611471565b90600052602060002001541015610eee576008805410610ed45760405162461bcd60e51b8152602060048201526012602482015271135a59dc985d1a5bdb88199a5b9a5cda195960721b6044820152606401610418565b60088054906000610ee4836114d3565b9190505550610e67565b60008115610f7357600360085481548110610f0b57610f0b611471565b906000526020600020015483610f2191906115f3565b604080516001600160a01b0387168152602081018690529081018290529091507fd44a6dd2bfac4f6bc02d116d96aa12c24e8580626b95cb6a2f543f18cb61bd4c9060600160405180910390a1610fed565b600460085481548110610f8857610f88611471565b906000526020600020015483610f9e91906115f3565b604080516001600160a01b0387168152602081018690529081018290529091507f360e9013a4321fcce6c9385c1811b27dedd609caddbba8e813e7e5c1d4a6507b906060015b60405180910390a15b8060016000828254610fff91906115da565b909155506106eb905084826111f6565b6001600160a01b038216600090815260076020526040902054600160701b90046001600160701b0316818110156110815760405162461bcd60e51b8152602060048201526016602482015275115e18d95959081c995cd95c9d995908185b5bdd5b9d60521b6044820152606401610418565b6001600160a01b0383166000908152600760205260408120546110b190600160e01b900463ffffffff16846115f3565b90506110bd8383611615565b6001600160a01b03851660008181526007602090815260409182902080546001600160701b0395909516600160701b026dffffffffffffffffffffffffffff60701b199095169490941790935580519182529181018590529081018290527f69ad942cd0be186fc035367df354cdda64c5048503ac199f931f2def922b3d3e90606001610fe4565b6001600160a01b03811661119b5760405162461bcd60e51b815260206004820152601860248201527f5a65726f2061646472657373206e6f7420616c6c6f77656400000000000000006044820152606401610418565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516340c10f1960e01b81526001600160a01b038316600482015260248101829052737873d09af3d6965988831c60c7d38dbbd2eaeab0906340c10f1990604401600060405180830381600087803b15801561125257600080fd5b505af1158015611266573d6000803e3d6000fd5b505050505050565b60006020828403121561128057600080fd5b5035919050565b6000806000806080858703121561129d57600080fd5b5050823594602084013594506040840135936060013592509050565b6001600160a01b0381168114610d8d57600080fd5b600080604083850312156112e157600080fd5b82356112ec816112b9565b915060208301356112fc816112b9565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561134657611346611307565b604052919050565b60008060006060848603121561136357600080fd5b833561136e816112b9565b92506020848101359250604085013567ffffffffffffffff8082111561139357600080fd5b818701915087601f8301126113a757600080fd5b8135818111156113b9576113b9611307565b6113cb601f8201601f1916850161131d565b915080825288848285010111156113e157600080fd5b80848401858401376000848284010152508093505050509250925092565b8015158114610d8d57600080fd5b60006020828403121561141f57600080fd5b813561142a816113ff565b9392505050565b60006020828403121561144357600080fd5b813561142a816112b9565b6020808252600990820152682737ba1027bbb732b960b91b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561149957600080fd5b5051919050565b6000602082840312156114b257600080fd5b815161142a816113ff565b634e487b7160e01b600052601160045260246000fd5b6000600182016114e5576114e56114bd565b5060010190565b805167ffffffffffffffff8116811461150457600080fd5b919050565b805163ffffffff8116811461150457600080fd5b600061010080838503121561153157600080fd5b6040519081019067ffffffffffffffff8211818310171561155457611554611307565b816040528351815260208401516020820152611572604085016114ec565b6040820152611583606085016114ec565b6060820152611594608085016114ec565b60808201526115a560a08501611509565b60a08201526115b660c08501611509565b60c082015260e084015191506115cb826112b9565b60e08101919091529392505050565b808201808211156115ed576115ed6114bd565b92915050565b60008261161057634e487b7160e01b600052601260045260246000fd5b500490565b818103818111156115ed576115ed6114bd56fea2646970667358221220b005022b4fb26ba2ecef9826459fe89bedb9f7df1d631b9590e8ee8fd837c28064736f6c63430008130033