UNPKG

@augumented-finance/protocol-v1

Version:

Augmented Protocol smart contracts

423 lines 27.7 kB
"use strict"; /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ Object.defineProperty(exports, "__esModule", { value: true }); exports.MigratorFactory = void 0; const contracts_1 = require("@ethersproject/contracts"); class MigratorFactory extends contracts_1.ContractFactory { constructor(signer) { super(_abi, _bytecode, signer); } deploy(overrides) { return super.deploy(overrides || {}); } getDeployTransaction(overrides) { return super.getDeployTransaction(overrides || {}); } attach(address) { return super.attach(address); } connect(signer) { return super.connect(signer); } static connect(address, signerOrProvider) { return new contracts_1.Contract(address, _abi, signerOrProvider); } } exports.MigratorFactory = MigratorFactory; const _abi = [ { anonymous: false, inputs: [ { indexed: true, internalType: "address", name: "previousOwner", type: "address", }, { indexed: true, internalType: "address", name: "newOwner", type: "address", }, ], name: "OwnershipTransferred", type: "event", }, { inputs: [ { internalType: "contract IMigrationAdapter[]", name: "migrated", type: "address[]", }, ], name: "admin_enableClaims", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "contract ILendableToken[]", name: "targets", type: "address[]", }, ], name: "admin_migrateAllThenEnableClaims", outputs: [ { internalType: "uint256", name: "count", type: "uint256", }, ], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "contract ILendableToken", name: "target", type: "address", }, ], name: "admin_migrateToToken", outputs: [ { internalType: "contract IMigrationAdapter[]", name: "migrated", type: "address[]", }, { internalType: "uint256", name: "count", type: "uint256", }, ], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "contract IMigrationAdapter", name: "adapter", type: "address", }, ], name: "admin_registerAdapter", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "contract IMigratorHook", name: "hook", type: "address", }, ], name: "admin_setHook", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "adapter", type: "address", }, { internalType: "contract IBalanceHook", name: "rewardPool", type: "address", }, ], name: "admin_setRewardPool", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "holder", type: "address", }, { internalType: "address", name: "token", type: "address", }, { internalType: "address", name: "to", type: "address", }, ], name: "admin_sweepToken", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "contract IMigrationAdapter", name: "adapter", type: "address", }, ], name: "admin_unregisterAdapter", outputs: [ { internalType: "bool", name: "", type: "bool", }, ], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "origin", type: "address", }, ], name: "admin_unregisterAdapterForToken", outputs: [ { internalType: "bool", name: "", type: "bool", }, ], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "token", type: "address", }, { internalType: "address", name: "holder", type: "address", }, ], name: "balanceForMigrate", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [], name: "claimAllMigrated", outputs: [ { internalType: "uint256", name: "claimedTokenTypes", type: "uint256", }, { internalType: "uint256", name: "notClaimableTokenTypes", type: "uint256", }, ], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "token", type: "address", }, ], name: "claimMigrated", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, { internalType: "bool", name: "", type: "bool", }, ], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "token", type: "address", }, { internalType: "uint256", name: "amount", type: "uint256", }, { internalType: "uint64", name: "referralCode", type: "uint64", }, ], name: "depositToMigrate", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "holder", type: "address", }, { internalType: "address", name: "token", type: "address", }, { internalType: "uint256", name: "amount", type: "uint256", }, { internalType: "uint64", name: "referralCode", type: "uint64", }, ], name: "depositToMigrateOnBehalf", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "token", type: "address", }, ], name: "getAdapter", outputs: [ { internalType: "contract IMigrationAdapter", name: "adapter", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [], name: "owner", outputs: [ { internalType: "address", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [], name: "renounceOwnership", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "newOwner", type: "address", }, ], name: "transferOwnership", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "token", type: "address", }, { internalType: "uint256", name: "maxAmount", type: "uint256", }, ], name: "withdrawFromMigrate", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "nonpayable", type: "function", }, ]; const _bytecode = "0x608060405234801561001057600080fd5b50600061001b61006a565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35061006e565b3390565b6121418061007d6000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c806373144043116100ad578063ac83e79f11610071578063ac83e79f1461048a578063c157c57c1461052d578063cf1d995814610553578063d40b980714610574578063f2fde38b146105a257610121565b80637314404314610395578063789352f8146103dc5780638da5cb5b14610408578063a74f3bfd1461042c578063a7d58b1b1461045257610121565b80634bc8f6ca116100f45780634bc8f6ca14610207578063655bed061461028857806367d04dff1461032b5780636d19820f14610351578063715018a61461038d57610121565b806315c7c9bb1461012657806321ccb2c3146101665780633a48c0ea146101a05780633f0de742146101c8575b600080fd5b6101546004803603604081101561013c57600080fd5b506001600160a01b03813581169160200135166105c8565b60408051918252519081900360200190f35b61018c6004803603602081101561017c57600080fd5b50356001600160a01b0316610652565b604080519115158252519081900360200190f35b6101c6600480360360208110156101b657600080fd5b50356001600160a01b03166107f7565b005b6101ee600480360360208110156101de57600080fd5b50356001600160a01b0316610c46565b6040805192835290151560208301528051918290030190f35b61022d6004803603602081101561021d57600080fd5b50356001600160a01b0316610cdd565b6040518080602001838152602001828103825284818151815260200191508051906020019060200280838360005b8381101561027357818101518382015260200161025b565b50505050905001935050505060405180910390f35b6101c66004803603602081101561029e57600080fd5b8101906020810181356401000000008111156102b957600080fd5b8201836020820111156102cb57600080fd5b803590602001918460208302840111640100000000831117156102ed57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610d4b945050505050565b6101c66004803603602081101561034157600080fd5b50356001600160a01b0316610daf565b6101546004803603606081101561036757600080fd5b5080356001600160a01b0316906020810135906040013567ffffffffffffffff16610e29565b6101c6610e41565b610154600480360360808110156103ab57600080fd5b5080356001600160a01b03908116916020810135909116906040810135906060013567ffffffffffffffff16610ee3565b610154600480360360408110156103f257600080fd5b506001600160a01b038135169060200135610f46565b610410610fbb565b604080516001600160a01b039092168252519081900360200190f35b61018c6004803603602081101561044257600080fd5b50356001600160a01b0316610fca565b6101546004803603606081101561046857600080fd5b506001600160a01b0381358116916020810135821691604090910135166110eb565b610154600480360360208110156104a057600080fd5b8101906020810181356401000000008111156104bb57600080fd5b8201836020820111156104cd57600080fd5b803590602001918460208302840111640100000000831117156104ef57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506112da945050505050565b6104106004803603602081101561054357600080fd5b50356001600160a01b031661140f565b61055b6114a5565b6040805192835260208301919091528051918290030190f35b6101c66004803603604081101561058a57600080fd5b506001600160a01b03813581169160200135166115e4565b6101c6600480360360208110156105b857600080fd5b50356001600160a01b03166116a7565b60006105d38361140f565b6001600160a01b0316637a050ea5836040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561061f57600080fd5b505afa158015610633573d6000803e3d6000fd5b505050506040513d602081101561064957600080fd5b50519392505050565b600061065c61179f565b6000546001600160a01b039081169116146106ac576040805162461bcd60e51b815260206004820181905260248201526000805160206120c2833981519152604482015290519081900360640190fd5b6000826001600160a01b03166306dea8676040518163ffffffff1660e01b815260040160206040518083038186803b1580156106e757600080fd5b505afa1580156106fb573d6000803e3d6000fd5b505050506040513d602081101561071157600080fd5b50516001600160a01b03811660009081526002602052604090205490915061073d5760009150506107f2565b6001600160a01b0380821660009081526002602052604090205460018054600019909201928616918390811061076f57fe5b6000918252602090912001546001600160a01b031614610794576000925050506107f2565b6001600160a01b038216600090815260026020526040812081905560018054839081106107bd57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506001925050505b919050565b6107ff61179f565b6000546001600160a01b0390811691161461084f576040805162461bcd60e51b815260206004820181905260248201526000805160206120c2833981519152604482015290519081900360640190fd5b6000816001600160a01b031663b16a19de6040518163ffffffff1660e01b815260040160206040518083038186803b15801561088a57600080fd5b505afa15801561089e573d6000803e3d6000fd5b505050506040513d60208110156108b457600080fd5b5051604080516318160ddd60e01b815290519192506000916001600160a01b038416916318160ddd916004808301926020929190829003018186803b1580156108fc57600080fd5b505afa158015610910573d6000803e3d6000fd5b505050506040513d602081101561092657600080fd5b50511161097a576040805162461bcd60e51b815260206004820152601c60248201527f76616c696420756e6465726c79696e6720697320726571756972656400000000604482015290519081900360640190fd5b6000826001600160a01b03166306dea8676040518163ffffffff1660e01b815260040160206040518083038186803b1580156109b557600080fd5b505afa1580156109c9573d6000803e3d6000fd5b505050506040513d60208110156109df57600080fd5b5051604080516318160ddd60e01b815290519192506000916001600160a01b038416916318160ddd916004808301926020929190829003018186803b158015610a2757600080fd5b505afa158015610a3b573d6000803e3d6000fd5b505050506040513d6020811015610a5157600080fd5b505111610aa5576040805162461bcd60e51b815260206004820152601860248201527f76616c6964206f726967696e2069732072657175697265640000000000000000604482015290519081900360640190fd5b306001600160a01b0316836001600160a01b0316633018205f6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610aea57600080fd5b505af1158015610afe573d6000803e3d6000fd5b505050506040513d6020811015610b1457600080fd5b50516001600160a01b031614610b5b5760405162461bcd60e51b81526004018080602001828103825260228152602001806120a06022913960400191505060405180910390fd5b6001600160a01b038181166000908152600260205260409020541615610bc8576040805162461bcd60e51b815260206004820152601b60248201527f746f6b656e20697320616c726561647920726567697374657265640000000000604482015290519081900360640190fd5b6001805480820182557fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60180546001600160a01b0319166001600160a01b0395861617905580549184166000908152600260209081526040808320859055949095168152600385529283208054918201815583529290912090910155565b600080610c528361140f565b6001600160a01b0316633f0de742336040518263ffffffff1660e01b815260040180826001600160a01b031681526020019150506040805180830381600087803b158015610c9f57600080fd5b505af1158015610cb3573d6000803e3d6000fd5b505050506040513d6040811015610cc957600080fd5b50805160209091015190925090505b915091565b60606000610ce961179f565b6000546001600160a01b03908116911614610d39576040805162461bcd60e51b815260206004820181905260248201526000805160206120c2833981519152604482015290519081900360640190fd5b610d42836117a3565b91509150915091565b610d5361179f565b6000546001600160a01b03908116911614610da3576040805162461bcd60e51b815260206004820181905260248201526000805160206120c2833981519152604482015290519081900360640190fd5b610dac81611b14565b50565b610db761179f565b6000546001600160a01b03908116911614610e07576040805162461bcd60e51b815260206004820181905260248201526000805160206120c2833981519152604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6000610e3733858585611bc6565b90505b9392505050565b610e4961179f565b6000546001600160a01b03908116911614610e99576040805162461bcd60e51b815260206004820181905260248201526000805160206120c2833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006001600160a01b038516610f31576040805162461bcd60e51b815260206004820152600e60248201526d3ab735b737bbb7103437b63232b960911b604482015290519081900360640190fd5b610f3d85858585611bc6565b95945050505050565b6000610f518361140f565b6001600160a01b031663615036c183336040518363ffffffff1660e01b815260040180838152602001826001600160a01b0316815260200192505050602060405180830381600087803b158015610fa757600080fd5b505af1158015610633573d6000803e3d6000fd5b6000546001600160a01b031690565b6000610fd461179f565b6000546001600160a01b03908116911614611024576040805162461bcd60e51b815260206004820181905260248201526000805160206120c2833981519152604482015290519081900360640190fd5b6001600160a01b038216600090815260026020526040902054611049575060006107f2565b6001600160a01b0382166000908152600260205260408120546001805460001990920192918390811061107857fe5b6000918252602090912001546001600160a01b0316141561109d5760009150506107f2565b6000600182815481106110ac57fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b03948516179055949091168152600290935250506040812055600190565b60006110f561179f565b6000546001600160a01b03908116911614611145576040805162461bcd60e51b815260206004820181905260248201526000805160206120c2833981519152604482015290519081900360640190fd5b6001600160a01b03841630146111e857836001600160a01b031663fe3c410b84846040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b0316815260200192505050602060405180830381600087803b1580156111b557600080fd5b505af11580156111c9573d6000803e3d6000fd5b505050506040513d60208110156111df57600080fd5b50519050610e3a565b6001600160a01b038216611243576040805162461bcd60e51b815260206004820152601d60248201527f76616c69642064657374696e6174696f6e206973207265717569726564000000604482015290519081900360640190fd5b6000836001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561129257600080fd5b505afa1580156112a6573d6000803e3d6000fd5b505050506040513d60208110156112bc57600080fd5b505190508015610e3757610e376001600160a01b0385168483611cf5565b60006112e461179f565b6000546001600160a01b03908116911614611334576040805162461bcd60e51b815260206004820181905260248201526000805160206120c2833981519152604482015290519081900360640190fd5b6060825167ffffffffffffffff8111801561134e57600080fd5b5060405190808252806020026020018201604052801561138257816020015b606081526020019060019003908161136d5790505b50905060005b83518110156113d75760006113af8583815181106113a257fe5b60200260200101516117a3565b8484815181106113bb57fe5b6020908102919091010191909152939093019250600101611388565b5060005b8151811015611408576114008282815181106113f357fe5b6020026020010151611b14565b6001016113db565b5050919050565b6001600160a01b0381166000908152600260205260408120548061147a576040805162461bcd60e51b815260206004820152601c60248201527f756e6b6e6f776e206f7220756e737570706f7274656420746f6b656e00000000604482015290519081900360640190fd5b60018082038154811061148957fe5b6000918252602090912001546001600160a01b03169392505050565b60008060005b6001548110156115df5760006001600160a01b0316600182815481106114cd57fe5b6000918252602090912001546001600160a01b031614156114ed576115d7565b600080600183815481106114fd57fe5b600091825260208220015460408051631f86f3a160e11b815233600482015281516001600160a01b0390931693633f0de74293602480840194939192918390030190829087803b15801561155057600080fd5b505af1158015611564573d6000803e3d6000fd5b505050506040513d604081101561157a57600080fd5b50805160209182015160408051808201909152600b81526a31b630b4b6b2b21020a39d60a91b9381019390935290935091506115b7908383611d4c565b806115c7576001909301926115d4565b81156115d4576001909401935b50505b6001016114ab565b509091565b6115ec61179f565b6000546001600160a01b0390811691161461163c576040805162461bcd60e51b815260206004820181905260248201526000805160206120c2833981519152604482015290519081900360640190fd5b816001600160a01b03166365fc09a6826040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561168b57600080fd5b505af115801561169f573d6000803e3d6000fd5b505050505050565b6116af61179f565b6000546001600160a01b039081169116146116ff576040805162461bcd60e51b815260206004820181905260248201526000805160206120c2833981519152604482015290519081900360640190fd5b6001600160a01b0381166117445760405162461bcd60e51b815260040180806020018281038252602681526020018061207a6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b6060600080836001600160a01b031663b16a19de6040518163ffffffff1660e01b815260040160206040518083038186803b1580156117e157600080fd5b505afa1580156117f5573d6000803e3d6000fd5b505050506040513d602081101561180b57600080fd5b50516001600160a01b03811660009081526003602052604090208054919250908061183d575060009250610cd8915050565b8067ffffffffffffffff8111801561185457600080fd5b5060405190808252806020026020018201604052801561187e578160200160208202803683370190505b50945060608167ffffffffffffffff8111801561189a57600080fd5b506040519080825280602002602001820160405280156118c4578160200160208202803683370190505b509050815b8015611a4d5780806001900391505060006001808684815481106118e957fe5b906000526020600020015403815481106118ff57fe5b6000918252602090912001546001600160a01b03169050806119215750611a48565b806001600160a01b03166399e4a6cd8a6040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561197057600080fd5b505af1158015611984573d6000803e3d6000fd5b505050508088888151811061199557fe5b60200260200101906001600160a01b031690816001600160a01b031681525050806001600160a01b0316631b8b13a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b505050506040513d6020811015611a1857600080fd5b50518351849089908110611a2857fe5b6001600160a01b0390921660209283029190910190910152506001909501945b6118c9565b506004546001600160a01b031615611b0b57600480546040805163364ba17560e21b81526001600160a01b038881169482019485526024820192835285516044830152855193169363d92e85d4938993879390916064909101906020808601910280838360005b83811015611acc578181015183820152602001611ab4565b505050509050019350505050600060405180830381600087803b158015611af257600080fd5b505af1158015611b06573d6000803e3d6000fd5b505050505b50505050915091565b60005b8151811015611bc25760006001600160a01b0316828281518110611b3757fe5b60200260200101516001600160a01b03161415611b5357611bba565b818181518110611b5f57fe5b60200260200101516001600160a01b03166351231f296040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611ba157600080fd5b505af1158015611bb5573d6000803e3d6000fd5b505050505b600101611b17565b5050565b600080611bd28561140f565b90506000816001600160a01b031663df60de9d6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015611c1157600080fd5b505af1158015611c25573d6000803e3d6000fd5b505050506040513d6020811015611c3b57600080fd5b50519050611c546001600160a01b038716888488611e04565b604080516390c203c560e01b81526001600160a01b038981166004830152602482018490526044820188905267ffffffffffffffff871660648301529151918416916390c203c5916084808201926020929091908290030181600087803b158015611cbe57600080fd5b505af1158015611cd2573d6000803e3d6000fd5b505050506040513d6020811015611ce857600080fd5b5051979650505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611d47908490611e64565b505050565b611d4783838360405160240180806020018481526020018315158152602001828103825285818151815260200191508051906020019080838360005b83811015611da0578181015183820152602001611d88565b50505050905090810190601f168015611dcd5780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529190526020810180516001600160e01b031663f102ee0560e01b179052945061201c9350505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611e5e908590611e64565b50505050565b611e76826001600160a01b031661203d565b611ec7576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310611f055780518252601f199092019160209182019101611ee6565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611f67576040519150601f19603f3d011682016040523d82523d6000602084013e611f6c565b606091505b509150915081611fc3576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115611e5e57808060200190516020811015611fdf57600080fd5b5051611e5e5760405162461bcd60e51b815260040180806020018281038252602a8152602001806120e2602a913960400191505060405180910390fd5b80516a636f6e736f6c652e6c6f67602083016000808483855afa5050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061207157508115155b94935050505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737361646170746572206973206e6f7420666f72207468697320636f6e74726f6c6c65724f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212204debbfb6aa018c76e6a7055120dcdf5f450a9e85ab22055c824894e98f230f7664736f6c634300060c0033"; //# sourceMappingURL=MigratorFactory.js.map