test-contracts-sovryn
Version:
Smart contracts for the Sovryn protocol and external integrations.
1,559 lines • 121 kB
JSON
{
"_format": "hh-sol-artifact-1",
"contractName": "Staking",
"sourceName": "contracts/governance/Staking/Staking.sol",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "admin",
"type": "address"
}
],
"name": "AdminAdded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "admin",
"type": "address"
}
],
"name": "AdminRemoved",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "bytes32",
"name": "hash",
"type": "bytes32"
}
],
"name": "ContractCodeHashAdded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "bytes32",
"name": "hash",
"type": "bytes32"
}
],
"name": "ContractCodeHashRemoved",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "delegator",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "lockedUntil",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "fromDelegate",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "toDelegate",
"type": "address"
}
],
"name": "DelegateChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "delegate",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "lockedUntil",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "previousBalance",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "newBalance",
"type": "uint256"
}
],
"name": "DelegateStakeChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "staker",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "previousDate",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "newDate",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amountStaked",
"type": "uint256"
}
],
"name": "ExtendedStakingDuration",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "staker",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "until",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "receiver",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "isGovernance",
"type": "bool"
}
],
"name": "StakingWithdrawn",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "staker",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "lockedUntil",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "totalStaked",
"type": "uint256"
}
],
"name": "TokensStaked",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "TokensUnlocked",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "vesting",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "receiver",
"type": "address"
}
],
"name": "VestingTokensWithdrawn",
"type": "event"
},
{
"constant": true,
"inputs": [],
"name": "DELEGATION_TYPEHASH",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "DOMAIN_TYPEHASH",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "MAX_DURATION",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "MAX_VOTING_WEIGHT",
"outputs": [
{
"internalType": "uint96",
"name": "",
"type": "uint96"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "SOVToken",
"outputs": [
{
"internalType": "contract IERC20",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "WEIGHT_FACTOR",
"outputs": [
{
"internalType": "uint96",
"name": "",
"type": "uint96"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "_admin",
"type": "address"
}
],
"name": "addAdmin",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "admins",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "allUnlocked",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint96",
"name": "balance",
"type": "uint96"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
"name": "date",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "startDate",
"type": "uint256"
}
],
"name": "computeWeightByDate",
"outputs": [
{
"internalType": "uint96",
"name": "weight",
"type": "uint96"
}
],
"payable": false,
"stateMutability": "pure",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "delegatee",
"type": "address"
},
{
"internalType": "uint256",
"name": "lockDate",
"type": "uint256"
}
],
"name": "delegate",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "delegatee",
"type": "address"
},
{
"internalType": "uint256",
"name": "lockDate",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "nonce",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "expiry",
"type": "uint256"
},
{
"internalType": "uint8",
"name": "v",
"type": "uint8"
},
{
"internalType": "bytes32",
"name": "r",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "s",
"type": "bytes32"
}
],
"name": "delegateBySig",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"name": "delegateStakingCheckpoints",
"outputs": [
{
"internalType": "uint32",
"name": "fromBlock",
"type": "uint32"
},
{
"internalType": "uint96",
"name": "stake",
"type": "uint96"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "delegates",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "uint256",
"name": "previousLock",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "until",
"type": "uint256"
}
],
"name": "extendStakingDuration",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "feeSharing",
"outputs": [
{
"internalType": "contract IFeeSharingProxy",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
"name": "lockedTS",
"type": "uint256"
}
],
"name": "getCurrentStakedUntil",
"outputs": [
{
"internalType": "uint96",
"name": "",
"type": "uint96"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "getCurrentVotes",
"outputs": [
{
"internalType": "uint96",
"name": "",
"type": "uint96"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "uint256",
"name": "date",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "getPriorStakeByDateForDelegatee",
"outputs": [
{
"internalType": "uint96",
"name": "",
"type": "uint96"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
"name": "date",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "getPriorTotalStakesForDate",
"outputs": [
{
"internalType": "uint96",
"name": "",
"type": "uint96"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint32",
"name": "blockNumber",
"type": "uint32"
},
{
"internalType": "uint256",
"name": "time",
"type": "uint256"
}
],
"name": "getPriorTotalVotingPower",
"outputs": [
{
"internalType": "uint96",
"name": "totalVotingPower",
"type": "uint96"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "uint256",
"name": "date",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "getPriorUserStakeByDate",
"outputs": [
{
"internalType": "uint96",
"name": "",
"type": "uint96"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "date",
"type": "uint256"
}
],
"name": "getPriorVotes",
"outputs": [
{
"internalType": "uint96",
"name": "votes",
"type": "uint96"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "date",
"type": "uint256"
}
],
"name": "getPriorWeightedStake",
"outputs": [
{
"internalType": "uint96",
"name": "votes",
"type": "uint96"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "getStakes",
"outputs": [
{
"internalType": "uint256[]",
"name": "dates",
"type": "uint256[]"
},
{
"internalType": "uint96[]",
"name": "stakes",
"type": "uint96[]"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint96",
"name": "amount",
"type": "uint96"
},
{
"internalType": "uint256",
"name": "until",
"type": "uint256"
}
],
"name": "getWithdrawAmounts",
"outputs": [
{
"internalType": "uint96",
"name": "",
"type": "uint96"
},
{
"internalType": "uint96",
"name": "",
"type": "uint96"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "uint96",
"name": "amount",
"type": "uint96"
},
{
"internalType": "uint256",
"name": "until",
"type": "uint256"
},
{
"internalType": "address",
"name": "receiver",
"type": "address"
}
],
"name": "governanceWithdraw",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "vesting",
"type": "address"
},
{
"internalType": "address",
"name": "receiver",
"type": "address"
}
],
"name": "governanceWithdrawVesting",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "isOwner",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "kickoffTS",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "migrateToNewStakingContract",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "newStakingContract",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "nonces",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "numDelegateStakingCheckpoints",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "numTotalStakingCheckpoints",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "numUserStakingCheckpoints",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "_sender",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
},
{
"internalType": "address",
"name": "_token",
"type": "address"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"name": "receiveApproval",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "_admin",
"type": "address"
}
],
"name": "removeAdmin",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "_feeSharing",
"type": "address"
}
],
"name": "setFeeSharing",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "_newStakingContract",
"type": "address"
}
],
"name": "setNewStakingContract",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "_vestingRegistryProxy",
"type": "address"
}
],
"name": "setVestingRegistry",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "uint96",
"name": "_weightScaling",
"type": "uint96"
}
],
"name": "setWeightScaling",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "uint96",
"name": "amount",
"type": "uint96"
},
{
"internalType": "uint256",
"name": "until",
"type": "uint256"
},
{
"internalType": "address",
"name": "stakeFor",
"type": "address"
},
{
"internalType": "address",
"name": "delegatee",
"type": "address"
}
],
"name": "stake",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "uint96",
"name": "amount",
"type": "uint96"
},
{
"internalType": "uint256",
"name": "until",
"type": "uint256"
},
{
"internalType": "address",
"name": "stakeFor",
"type": "address"
},
{
"internalType": "address",
"name": "delegatee",
"type": "address"
}
],
"name": "stakeWithApproval",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "cliff",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "duration",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "intervalLength",
"type": "uint256"
},
{
"internalType": "address",
"name": "stakeFor",
"type": "address"
},
{
"internalType": "address",
"name": "delegatee",
"type": "address"
}
],
"name": "stakesBySchedule",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"name": "timestampToLockDate",
"outputs": [
{
"internalType": "uint256",
"name": "lockDate",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"name": "totalStakingCheckpoints",
"outputs": [
{
"internalType": "uint32",
"name": "fromBlock",
"type": "uint32"
},
{
"internalType": "uint96",
"name": "stake",
"type": "uint96"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "unlockAllTokens",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"name": "userStakingCheckpoints",
"outputs": [
{
"internalType": "uint32",
"name": "fromBlock",
"type": "uint32"
},
{
"internalType": "uint96",
"name": "stake",
"type": "uint96"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"name": "vestingCodeHashes",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "vestingRegistryLogic",
"outputs": [
{
"internalType": "contract VestingRegistryLogic",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "vestingWhitelist",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "weightScaling",
"outputs": [
{
"internalType": "uint96",
"name": "",
"type": "uint96"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "uint256",
"name": "date",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "startDate",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "blockNumber",
"type": "uint256"
}
],
"name": "weightedStakeByDate",
"outputs": [
{
"internalType": "uint96",
"name": "power",
"type": "uint96"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "uint96",
"name": "amount",
"type": "uint96"
},
{
"internalType": "uint256",
"name": "until",
"type": "uint256"
},
{
"internalType": "address",
"name": "receiver",
"type": "address"
}
],
"name": "withdraw",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x60c0604052600a608081905269534f565374616b696e6760b01b60a09081526200002d9160029190620000ae565b506005805460ff19169055600d80546001600160a01b0316600360a01b179055600062000059620000a9565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35062000150565b335b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620000f157805160ff191683800117855562000121565b8280016001018555821562000121579182015b828111156200012157825182559160200191906001019062000104565b506200012f92915062000133565b5090565b620000ab91905b808211156200012f57600081556001016200013a565b61555980620001606000396000f3fe608060405234801561001057600080fd5b506004361061038d5760003560e01c8063836eebee116101de578063b4b5ea571161010f578063db27ec18116100ad578063e97ffacb1161007c578063e97ffacb14610767578063eefb8c471461077a578063f09cfc641461078d578063f2fde38b146107a05761038d565b8063db27ec1814610726578063dfb267c214610739578063e63a562e1461074c578063e7a324dc1461075f5761038d565b8063cf7b684a116100e9578063cf7b684a146106e5578063d27569e7146106f8578063d5c3846414610700578063dab6ca44146107135761038d565b8063b4b5ea57146106b7578063b8a98732146106ca578063bf626ec1146106dd5761038d565b806396a590c11161017c578063a58848c511610156578063a58848c51461068c578063adae900214610694578063ae81dfe4146106a7578063b1724b46146106af5761038d565b806396a590c1146106505780639929e886146106715780639a377b82146106795761038d565b80638f32d59b116101b85780638f32d59b146106025780638f4ffcb11461060a5780639436e7d41461061d57806394c2ce581461063d5761038d565b8063836eebee146105d45780638da5cb5b146105e75780638dae1b16146105ef5761038d565b8063429b62e5116102c357806368cefccc1161026157806372ec97951161023057806372ec97951461057a5780637ba6f4581461058d5780637ecebe00146105ae578063800b64ca146105c15761038d565b806368cefccc146105205780636b6fde0e14610541578063704802751461055457806370a08231146105675761038d565b80635419675f1161029d5780635419675f146104ea5780635e0be607146104f2578063626ee2d9146104fa57806362cf8a081461050d5761038d565b8063429b62e5146104b1578063450b0601146104c45780634b2fea1e146104d75761038d565b80631785f53c1161033057806325629ec01161030a57806325629ec01461045857806327dd1b001461046b57806337e6b1c11461048b5780633827fca51461049e5761038d565b80631785f53c1461042a57806320606b701461043d5780632522d7ba146104455761038d565b806307392cc01161036c57806307392cc0146103da5780630c09ddfd146103fa578063104932cf1461040d57806317748adc146104155761038d565b8062073f9914610392578063026e402b146103b057806303a18fa3146103c5575b600080fd5b61039a6107b3565b6040516103a79190614d3b565b60405180910390f35b6103c36103be366004613a61565b6107b9565b005b6103cd6107d3565b6040516103a79190614dff565b6103ed6103e8366004613d2f565b6107e2565b6040516103a79190614d2d565b6103c3610408366004613c9c565b6107f7565b6103cd610835565b61041d610844565b6040516103a79190615040565b6103c3610438366004613a01565b610849565b61039a6108c8565b61041d610453366004613e84565b6108df565b6103c3610466366004613f23565b610945565b61047e610479366004613a61565b61095a565b6040516103a79190614c73565b61041d610499366004613b0f565b610980565b6103c36104ac366004613a27565b6109f8565b6103ed6104bf366004613a01565b610b0a565b6103c36104d2366004613a01565b610b1f565b6103c36104e5366004613dcd565b610b8b565b6103c3610c2a565b6103c3610c59565b6103c3610508366004613a01565b610d41565b61041d61051b366004613dae565b610dad565b61053361052e366004613c59565b610ee8565b6040516103a7929190615032565b61053361054f366004613c59565b610f23565b6103c3610562366004613a01565b610f5e565b61041d610575366004613a01565b610fd5565b61039a610588366004613d2f565b611044565b6105a061059b366004613a01565b61108f565b6040516103a7929190614d08565b61039a6105bc366004613a01565b6111ca565b6103c36105cf366004613ee0565b6111dc565b61041d6105e2366004613b0f565b61122a565b61047e611282565b61041d6105fd366004613b5c565b611291565b6103ed611313565b6103c3610618366004613a91565b611337565b61063061062b366004613d2f565b61152b565b6040516103a79190615024565b61063061064b366004613a61565b611543565b61066361065e366004613ec1565b611566565b6040516103a7929190615084565b6103ed61158f565b6103c3610687366004613a01565b611598565b6103cd61160a565b6103ed6106a2366004613a01565b611619565b61047e61162e565b61039a611642565b61041d6106c5366004613a01565b61164a565b6103c36106d8366004613ea3565b611660565b61041d6116ec565b61041d6106f3366004613b0f565b611702565b61041d61173f565b61041d61070e366004613d2f565b611744565b6103c3610721366004613ee0565b6117a0565b610630610734366004613a61565b6117ba565b610533610747366004613e54565b6117dd565b6103c361075a366004613bbd565b611812565b61039a6119d0565b61041d610775366004613b0f565b6119dc565b6103c3610788366004613dae565b611c25565b61041d61079b366004613dae565b611dc9565b6103c36107ae366004613a01565b611fa2565b60015481565b6107c4338383611fd2565b6107cf33838361208b565b5050565b600d546001600160a01b031681565b60106020526000908152604090205460ff1681565b33301461081f5760405162461bcd60e51b815260040161081690614f4e565b60405180910390fd5b61082e858585858560006121c4565b5050505050565b6011546001600160a01b031681565b600981565b610851611313565b61086d5760405162461bcd60e51b815260040161081690614f4e565b6001600160a01b0381166000908152600f602052604090819020805460ff19169055517fa3b62bc36326052d97ea62d63c3d60308ed4c3ea8ac079dd8499f1e9c4f80c0f906108bd908390614c73565b60405180910390a150565b6040516108d490614c5d565b604051809103902081565b6000806108eb83611044565b905063059fa6008101815b81811161093c576109308461091283868a63ffffffff166123a2565b6040518060800160405280605581526020016151e260559139612408565b935062127500016108f6565b50505092915050565b610954338585858560006121c4565b50505050565b60046020908152600092835260408084209091529082529020546001600160a01b031681565b60008061098c83611044565b905063059fa6008101815b8181116109ee5760006109ac8883868a611291565b90506001600160601b038116156109e3576109e085826040518060800160405280604c81526020016153ff604c9139612408565b94505b506212750001610997565b5050509392505050565b610a00611313565b80610a1a5750336000908152600f602052604090205460ff165b610a365760405162461bcd60e51b815260040161081690614f4e565b6001600160a01b0382166000818152600e602052604090819020805460ff1916600117905551633c7925e360e11b81526378f24bc690610a7a908490600401614c73565b600060405180830381600087803b158015610a9457600080fd5b505af1158015610aa8573d6000803e3d6000fd5b5050506001600160a01b0383166000908152600e602052604090819020805460ff19169055517f2366e0b6b1af17c0ceed50685c570d519cae11e7faaf007bbe667e94a5ee3cd59150610afe9084908490614c8f565b60405180910390a15050565b600f6020526000908152604090205460ff1681565b610b27611313565b610b435760405162461bcd60e51b815260040161081690614f4e565b6001600160a01b038116610b695760405162461bcd60e51b815260040161081690614e5e565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6000610b98864201611044565b905063059fa600851115610bae5763059fa60094505b6000610bbb864201611044565b905060008583830381610bca57fe5b0460010190506000818a81610bdb57fe5b04905060018210610bfc57610bfc336001840383028c0386898960016121c4565b8387015b838111610c1d57610c163383838a8a60016121c4565b8701610c00565b5050505050505050505050565b60055461010090046001600160a01b0316610c575760405162461bcd60e51b815260040161081690614e2e565b565b610c61611313565b610c7d5760405162461bcd60e51b815260040161081690614f4e565b6005805460ff191660011790556003546040516370a0823160e01b81527fd8cc4e8d808fe950b07bfffcd83eebf1190cd35ea77fe0c8a7d75a6e9b90e5c1916001600160a01b0316906370a0823190610cda903090600401614c73565b60206040518083038186803b158015610cf257600080fd5b505afa158015610d06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610d2a9190810190613d90565b604051610d379190614d3b565b60405180910390a1565b610d49611313565b610d655760405162461bcd60e51b815260040161081690614f4e565b6001600160a01b038116610d8b5760405162461bcd60e51b815260040161081690614f9e565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b600081831015610dcf5760405162461bcd60e51b815260040161081690614f3e565b81830363059fa600811115610df65760405162461bcd60e51b815260040161081690614f5e565b6000620151808263059fa600036001600160601b031681610e1357fe5b049050610edf600a621232106001600160601b0316610e93600a600902610e75621232108788026040518060400160405280601f81526020017f756e646572666c6f77206f6e207765696768742063616c63756c6174696f6e0081525061243b565b6040518060600160405280602d8152602001615237602d913961247a565b6001600160601b031681610ea357fe5b046040518060400160405280601e81526020017f6f766572666c6f77206f6e2077656967687420636f6d7075746174696f6e0000815250612408565b95945050505050565b600a60209081526000938452604080852082529284528284209052825290205463ffffffff811690600160201b90046001600160601b031682565b600860209081526000938452604080852082529284528284209052825290205463ffffffff811690600160201b90046001600160601b031682565b610f66611313565b610f825760405162461bcd60e51b815260040161081690614f4e565b6001600160a01b0381166000908152600f602052604090819020805460ff19166001179055517f44d6d25963f097ad14f29f06854a01f575648a1ef82f30e562ccd3889717e339906108bd908390614c73565b6001546000905b63059fa6004201811161103e5761103282610ff785846124d8565b6040518060400160405280601c81526020017f5374616b696e673a3a62616c616e63654f663a206f766572666c6f7700000000815250612408565b91506212750001610fdc565b50919050565b60006001548210156110685760405162461bcd60e51b815260040161081690614eee565b60006212750060015484038161107a57fe5b04905060015462127500820201915050919050565b60608060006110a363059fa6004201611044565b60015490915060009062127500015b8281116110e55760006110c587836124d8565b6001600160601b031611156110db576001909101905b62127500016110b2565b5080604051908082528060200260200182016040528015611110578160200160208202803883390190505b5093508060405190808252806020026020018201604052801561113d578160200160208202803883390190505b5060015490935060009062127500015b8381116111c157600061116088836124d8565b90506001600160601b038116156111b6578187848151811061117e57fe5b6020026020010181815250508086848151811061119757fe5b6001600160601b03909216602092830291909101909101526001909201915b50621275000161114d565b50505050915091565b600c6020526000908152604090205481565b336000908152600e602052604090205460ff1661120b5760405162461bcd60e51b815260040161081690614f4e565b6112188383836001612539565b6112258383836001612823565b505050565b60008061123683611044565b905063059fa6008101815b8181116109ee57611276846112588984878b612885565b6040518060800160405280604a81526020016152d5604a9139612408565b93506212750001611241565b6000546001600160a01b031690565b60008061129f8686856128ed565b90506001600160601b038116156113055760006112bc8686610dad565b9050600a6001600160601b03166112ec83836040518060600160405280603d8152602001615264603d913961247a565b6001600160601b0316816112fc57fe5b0492505061130a565b600091505b50949350505050565b600080546001600160a01b0316611328612b42565b6001600160a01b031614905090565b61133f612b46565b6001600160a01b0316336001600160a01b03161461136f5760405162461bcd60e51b815260040161081690614f4e565b336001600160a01b038416146113975760405162461bcd60e51b815260040161081690614f4e565b600060606113a3612b55565b905060006113e685858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612bad92505050565b905060005b82518110156114345782818151811061140057fe5b60200260200101516001600160e01b031916826001600160e01b031916141561142c5760019350611434565b6001016113eb565b50826114525760405162461bcd60e51b815260040161081690614eae565b600080600060201b878760405160200161146e93929190614bf7565b6040516020818303038152906040528060200190516114909190810190613d4d565b9093509150506001600160a01b03808316908b16146114c15760405162461bcd60e51b815260040161081690614f2e565b8881146114e05760405162461bcd60e51b815260040161081690614fbe565b61151f87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612bb492505050565b50505050505050505050565b60076020526000908152604090205463ffffffff1681565b600960209081526000928352604080842090915290825290205463ffffffff1681565b6000806115738484612c89565b600061157f8585612cf6565b80860393509150505b9250929050565b60055460ff1681565b6115a0611313565b6115bc5760405162461bcd60e51b815260040161081690614f4e565b6001600160a01b0381166115e25760405162461bcd60e51b815260040161081690614f7e565b600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6003546001600160a01b031681565b600e6020526000908152604090205460ff1681565b60055461010090046001600160a01b031681565b63059fa60081565b600061165a82600143034261122a565b92915050565b611668611313565b6116845760405162461bcd60e51b815260040161081690614f4e565b6001600160601b0381166001118015906116a8575060096001600160601b03821611155b6116c45760405162461bcd60e51b815260040161081690614efe565b600d80546001600160601b03909216600160a01b026001600160a01b03909216919091179055565b600d54600160a01b90046001600160601b031681565b6000806117108585856128ed565b90506001600160601b03811615801561172c575061172c612d41565b15611735575060015b90505b9392505050565b600a81565b60008181526007602052604081205463ffffffff1680611765576000611738565b6000838152600660209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03169392505050565b6117ad8383836000612539565b6112258383836000612823565b600b60209081526000928352604080842090915290825290205463ffffffff1681565b600660209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b600060405161182090614c5d565b604051809103902060026040516118379190614c20565b6040518091039020611847612dc7565b3060405160200161185b9493929190614d95565b604051602081830303815290604052805190602001209050600060405161188190614c68565b60405190819003812061189e918b908b908b908b90602001614d49565b604051602081830303815290604052805190602001209050600082826040516020016118cb929190614c2c565b6040516020818303038152906040528051906020012090506000600182888888604051600081526020016040526040516119089493929190614dca565b6020604051602081039080840390855afa15801561192a573d6000803e3d6000fd5b50505060206040510351905061193f81612dcb565b61195b5760405162461bcd60e51b815260040161081690614ede565b6001600160a01b0381166000908152600c60205260409020805460018101909155891461199a5760405162461bcd60e51b815260040161081690614fde565b874211156119ba5760405162461bcd60e51b815260040161081690614e1e565b6119c5818c8c611fd2565b610c1d818c8c61208b565b6040516108d490614c68565b60006119e6612e04565b8210611a045760405162461bcd60e51b815260040161081690614fce565b6001600160a01b038416600090815260096020908152604080832086845290915290205463ffffffff1680611a3d576000915050611738565b6001600160a01b0385166000908152600860209081526040808320878452825280832063ffffffff600019860181168552925290912054168310611ac9576001600160a01b038516600090815260086020908152604080832087845282528083206000199490940163ffffffff1683529290522054600160201b90046001600160601b03169050611738565b6001600160a01b0385166000908152600860209081526040808320878452825280832083805290915290205463ffffffff16831015611b0c576000915050611738565b600060001982015b8163ffffffff168163ffffffff161115611bd757600282820363ffffffff16048103611b3e613950565b506001600160a01b03881660009081526008602090815260408083208a8452825280832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b03169181019190915290871415611bb2576020015194506117389350505050565b805163ffffffff16871115611bc957819350611bd0565b6001820392505b5050611b14565b506001600160a01b0386166000908152600860209081526040808320888452825280832063ffffffff909416835292905220546001600160601b03600160201b909104169150509392505050565b611c2e81611044565b905080821115611c505760405162461bcd60e51b815260040161081690614e3e565b6000611c6163059fa6004201611044565b905080821115611c6f578091505b6000611c7f3385600143036128ed565b90506000816001600160601b031611611caa5760405162461bcd60e51b815260040161081690614f1e565b611cb5338583612e08565b611cc0338483612e99565b611cca8482612f1c565b611cd48382612f94565b336000908152600460209081526040808320878452909152808220548583529120546001600160a01b03918216911680611d3e5750336000908152600460209081526040808320878452909152902080546001600160a01b0319166001600160a01b038316179055805b336000908152600460209081526040808320898452909152902080546001600160a01b0319169055611d71828785612fff565b611d7c81868561309c565b336001600160a01b03167f809d79c94c86576d61afef75495b8df415224bf885310fed7ea315039f8c5b4c878786604051611db993929190614fee565b60405180910390a2505050505050565b6000611dd3612e04565b8210611df15760405162461bcd60e51b815260040161081690614fae565b60008381526007602052604090205463ffffffff1680611e1557600091505061165a565b600084815260066020908152604080832063ffffffff600019860181168552925290912054168310611e7d5760008481526006602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b0316905061165a565b600084815260066020908152604080832083805290915290205463ffffffff16831015611eae57600091505061165a565b600060001982015b8163ffffffff168163ffffffff161115611f6757600282820363ffffffff16048103611ee0613950565b50600087815260066020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b03169181019190915290871415611f425760200151945061165a9350505050565b805163ffffffff16871115611f5957819350611f60565b6001820392505b50506