Address Contract Partially Verified
Address
0xeF101508bf4DC6CF0f0a0C135f39a41faB4E4389
Balance
0 ETH
Nonce
1
Code Size
20784 bytes
Creator
0x48aB8AdF...be92 at tx 0xc34e30b6...502729
Proxy
EIP-1967 Proxy Implementation: 0xBB51273D...feD0
Indexed Transactions
0
Contract Bytecode
20784 bytes
0x6080604052600436106101e2575f3560e01c80638a4adf2411610101578063c7b9d53011610094578063d65ba11a11610063578063d65ba11a14610671578063ecf7085814610686578063f23a6e611461069b578063fde813a8146104f0576101e2565b8063c7b9d530146105d2578063ca70baa3146105f1578063d01f63f514610629578063d19a3bb81461064a576101e2565b8063b5f163ff116100d0578063b5f163ff1461052e578063bc197c811461054d578063bdc8144b14610594578063c04dad5d146105b3576101e2565b80638a4adf24146104be5780638adb2ca9146104dd5780639d7fb70c146104f0578063b543503e1461050f576101e2565b80633d6cb575116101795780635d265d3f116101485780635d265d3f146103f457806377ca76b81461043557806381cd63771461045457806385e1f4d014610473576101e2565b80633d6cb5751461038357806346aa2f12146103a257806349317f1d146103c1578063503160d9146103d5576101e2565b80631fe4a686116101b55780631fe4a686146102c557806324c73dda146102fb57806334c041a51461032e57806335ad30b514610361576101e2565b806301ffc9a71461022357806304bd46291461025757806310bc7abf1461028557806318354273146102b1575b3480156101ed575f80fd5b5073bb51273d6c746910c7c06fe718f30c936170fed0365f80375f80365f845af43d5f803e80801561021d573d5ff35b3d5ffd5b005b34801561022e575f80fd5b5061024261023d3660046145a0565b6106c7565b60405190151581526020015b60405180910390f35b348015610262575f80fd5b506102776102713660046145db565b505f1990565b60405190815260200161024e565b348015610290575f80fd5b506102a461029f3660046146c8565b6106fd565b60405161024e91906146f9565b3480156102bc575f80fd5b506102216107ae565b3480156102d0575f80fd5b505f546102e3906001600160a01b031681565b6040516001600160a01b03909116815260200161024e565b348015610306575f80fd5b506102e37f00000000000000000000000017a332dc7b40ae701485023b219e9d6f493a251481565b348015610339575f80fd5b506102e37f000000000000000000000000d85ec15a9f814d6173bf1a89273bfb3964aadaec81565b34801561036c575f80fd5b506103756108d9565b60405161024e929190614778565b34801561038e575f80fd5b5061022161039d36600461479c565b610988565b3480156103ad575f80fd5b506102776103bc3660046145db565b61099c565b3480156103cc575f80fd5b50610277610a45565b3480156103e0575f80fd5b506102216103ef36600461479c565b610a5b565b3480156103ff575f80fd5b5060408051600481526024810182526020810180516001600160e01b031663440368a360e01b179052905161024e915f91614800565b348015610440575f80fd5b5061027761044f36600461479c565b610a6c565b34801561045f575f80fd5b5061022161046e36600461481a565b610a8b565b34801561047e575f80fd5b506104a67f000000000000000000000000000000000000000000000000000000000000000181565b6040516001600160401b03909116815260200161024e565b3480156104c9575f80fd5b506001546102e3906001600160a01b031681565b6102216104eb36600461483d565b610b4a565b3480156104fb575f80fd5b5061022161050a36600461479c565b610f7a565b34801561051a575f80fd5b506102216105293660046145db565b610f82565b348015610539575f80fd5b5061027761054836600461479c565b611072565b348015610558575f80fd5b5061057b6105673660046148f7565b63bc197c8160e01b98975050505050505050565b6040516001600160e01b0319909116815260200161024e565b34801561059f575f80fd5b506102216105ae36600461479c565b611081565b3480156105be575f80fd5b506102216105cd3660046149ba565b6110e1565b3480156105dd575f80fd5b506102216105ec3660046145db565b6111a3565b3480156105fc575f80fd5b5060015461061490600160a01b900463ffffffff1681565b60405163ffffffff909116815260200161024e565b348015610634575f80fd5b5061063d611264565b60405161024e9190614a77565b348015610655575f80fd5b506102e373bb51273d6c746910c7c06fe718f30c936170fed081565b34801561067c575f80fd5b5061027760025481565b348015610691575f80fd5b5061027760035481565b3480156106a6575f80fd5b5061057b6106b5366004614a89565b63f23a6e6160e01b9695505050505050565b5f6001600160e01b031982166301ffc9a760e01b14806106f757506001600160e01b03198216630271189760e51b145b92915050565b8051606090806001600160401b0381111561071a5761071a6145f6565b604051908082528060200260200182016040528015610743578160200160208202803683370190505b5091505f5b818110156107a75761077d84828151811061076557610765614aff565b6020026020010151600461127090919063ffffffff16565b83828151811061078f5761078f614aff565b91151560209283029190910190910152600101610748565b5050919050565b6040516321f8a72160e01b81527fbddfa8c39a1f6275bcfb3aa5c70638c466999edbf14e6162d81b3492caca9fce60048201525f907f00000000000000000000000017a332dc7b40ae701485023b219e9d6f493a25146001600160a01b0316906321f8a72190602401602060405180830381865afa158015610832573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108569190614b13565b90507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25f6108838261128a565b905080156108d45761089f6001600160a01b03831684836112f2565b6040518181527f76a820ad5e56aebcfa13f60a4ec2e8453550cca0e77446a259782e547c68b32b906020015b60405180910390a15b505050565b606080600660078180548060200260200160405190810160405280929190818152602001828054801561092957602002820191905f5260205f20905b815481526020019060010190808311610915575b505050505091508080548060200260200160405190810160405280929190818152602001828054801561097957602002820191905f5260205f20905b815481526020019060010190808311610965575b50505050509050915091509091565b610990611351565b6109998161138f565b50565b5f807f000000000000000000000000ef101508bf4dc6cf0f0a0c135f39a41fab4e43896001600160a01b03166301e1d1146040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109fa573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a1e9190614b2e565b60035490915080821015610a3b57610a368282614b59565b610a3d565b5f5b949350505050565b5f610a4e611351565b610a56611555565b905090565b610a63611351565b6109998161175a565b60068181548110610a7b575f80fd5b5f91825260209091200154905081565b6040516348e4a64960e01b81523360048201527f000000000000000000000000ef101508bf4dc6cf0f0a0c135f39a41fab4e43896001600160a01b0316906348e4a649906024015f6040518083038186803b158015610ae8575f80fd5b505afa158015610afa573d5f803e3d5ffd5b505050508063ffffffff165f03610b24576040516360d4aee560e11b815260040160405180910390fd5b6001805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b5f546001600160a01b03163314610b74576040516312b9d85760e01b815260040160405180910390fd5b5f610b7f8280614b6c565b91505f9050610b916020840184614b6c565b91505f9050610ba36040850185614b6c565b90509050815f03610bc75760405163ec5e1a0b60e01b815260040160405180910390fd5b805f03610be757604051636e1d500960e11b815260040160405180910390fd5b8183141580610c045750610bfe6060850185614b6c565b90508114155b15610c2257604051634456f5e960e11b815260040160405180910390fd5b6002545f90815b85811015610ca2575f5b82811015610c995760068181548110610c4e57610c4e614aff565b5f91825260209091200154610c638980614b6c565b84818110610c7357610c73614aff565b9050602002013503610c915783610c8981614bb1565b945050610c99565b600101610c33565b50600101610c29565b50848214610cc35760405163173b81c360e21b815260040160405180910390fd5b50600190505b83811015610d4657610cdb8580614b6c565b610ce6600184614b59565b818110610cf557610cf5614aff565b60200291909101359050610d098680614b6c565b83818110610d1957610d19614aff565b9050602002013511610d3e5760405163ac5c256f60e01b815260040160405180910390fd5b600101610cc9565b505f5b81811015610e2f5760018110158015610db55750610d6a6040860186614b6c565b610d75600184614b59565b818110610d8457610d84614aff565b90506020020135858060400190610d9b9190614b6c565b83818110610dab57610dab614aff565b9050602002013511155b15610dd3576040516345109f5760e11b815260040160405180910390fd5b610e0a610de36040870187614b6c565b83818110610df357610df3614aff565b90506020020135600461127090919063ffffffff16565b610e275760405163d902535160e01b815260040160405180910390fd5b600101610d49565b505f610e6f610e3e8680614b6c565b610e4b6020890189614b6c565b610e5860408b018b614b6c565b610e6560608d018d614b6c565b8d608001356119f3565b90505f610e9b7fcfa3537c7b7ad87a0dd290c1d493cb256cbf491441572cd66c66c6af6310399b611c69565b9050610eaf81835f01518460200151611cf2565b604051633452c8ed60e21b81526001600160a01b0382169063d14b23b490610edb908590600401614bc9565b5f604051808303815f87803b158015610ef2575f80fd5b505af1158015610f04573d5f803e3d5ffd5b50505050610f727f00000000000000000000000001df6fb6a28a89d6bfa53b2b3f20644abf417678878060400190610f3c9190614b6c565b808060200260200160405190810160405280939291908181526020018383602002808284375f92019190915250611d7492505050565b505050505050565b610999611351565b6040516348e4a64960e01b81523360048201527f000000000000000000000000ef101508bf4dc6cf0f0a0c135f39a41fab4e43896001600160a01b0316906348e4a649906024015f6040518083038186803b158015610fdf575f80fd5b505afa158015610ff1573d5f803e3d5ffd5b5050506001600160a01b038216905061101d5760405163538ba4f960e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f8e902340d35762a5a36507c20fe38e5d549a721d9f846d6de7f397b5c26ab853906020015b60405180910390a150565b60078181548110610a7b575f80fd5b6001546001600160a01b031633146110ac57604051634f9aa11760e11b815260040160405180910390fd5b60038190556040518181527f5d2e73196f8ba1b44e887e2bcc9bcd1f3e657add341d4a0a632ffff00d6903f290602001611067565b6001546001600160a01b0316331461110c57604051634f9aa11760e11b815260040160405180910390fd5b81518151811461112f57604051634456f5e960e11b815260040160405180910390fd5b805f0361114f576040516342c313c360e11b815260040160405180910390fd5b5f5b8181101561119d5761119584828151811061116e5761116e614aff565b602002602001015184838151811061118857611188614aff565b60200260200101516122b8565b600101611151565b50505050565b6040516348e4a64960e01b81523360048201527f000000000000000000000000ef101508bf4dc6cf0f0a0c135f39a41fab4e43896001600160a01b0316906348e4a649906024015f6040518083038186803b158015611200575f80fd5b505afa158015611212573d5f803e3d5ffd5b50505f80546001600160a01b0319166001600160a01b0385169081179091556040519081527f276625620b877c2ddc0a05d68b81971639085fa26d23dfa86eec6460e6fac5b992506020019050611067565b6060610a566004612325565b5f81815260018301602052604081205415155b9392505050565b6040516370a0823160e01b81523060048201525f906001600160a01b038316906370a0823190602401602060405180830381865afa1580156112ce573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106f79190614b2e565b6040516001600160a01b038381166024830152604482018390526108d491859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050612331565b33301461138d5760405162461bcd60e51b815260206004820152600560248201526410b9b2b63360d91b60448201526064015b60405180910390fd5b565b6002546060907f000000000000000000000000a195608c2306a26f727d5199d5a382a4508308da9060010361143d575f6113c884612392565b60408051602081018252828152905191925063407c7b1d60e01b916113f09190602401614d0e565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b038381831617835250505050925061143782825f015183602001516125c0565b506114b8565b5f6114478461261c565b604080516020810182528281529051919250630b0702e960e21b9161146f9190602401614e81565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b03838183161783525050505092506114b682825f01518360200151611cf2565b505b5f80826001600160a01b0316846040516114d29190614f98565b5f604051808303815f865af19150503d805f811461150b576040519150601f19603f3d011682016040523d82523d5f602084013e611510565b606091505b5091509150610f7282826040518060400160405280601a81526020017f43616c6c526576657274576974684e6f52657475726e44617461000000000000815250612d0f565b60025460068054604080516020808402820181019092528281525f948594909385938301828280156115a457602002820191905f5260205f20905b815481526020019060010190808311611590575b505050505090505f7f00000000000000000000000001df6fb6a28a89d6bfa53b2b3f20644abf41767890505f5b8381101561171d575f6115fc8483815181106115ef576115ef614aff565b6020026020010151612d28565b505090505f836001600160a01b031662fdd58e3087868151811061162257611622614aff565b60200260200101516040518363ffffffff1660e01b815260040161165b9291906001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015611676573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061169a9190614b2e565b60405163b7ba28cd60e01b8152600481018290529091506001600160a01b0383169063b7ba28cd90602401602060405180830381865afa1580156116e0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117049190614b2e565b61170e9088614fb3565b965082600101925050506115d1565b506117477f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc261128a565b6117519085614fb3565b94505050505090565b5f6002546001146117ca5763fa0f64eb60e01b604051806020016040528061178185612d5b565b90526040516117939190602401614e81565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261182b565b63b19dcc3360e01b60405180602001604052806117e685613203565b90526040516117f89190602401614d0e565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091525b90507f000000000000000000000000a195608c2306a26f727d5199d5a382a4508308da6118826001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2168285613375565b5f80826001600160a01b03168460405161189c9190614f98565b5f604051808303815f865af19150503d805f81146118d5576040519150601f19603f3d011682016040523d82523d5f602084013e6118da565b606091505b509150915061191f82826040518060400160405280601a81526020017f43616c6c526576657274576974684e6f52657475726e44617461000000000000815250612d0f565b50604051636eb1769f60e11b81523060048201526001600160a01b0384811660248301525f917f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc29091169063dd62ed3e90604401602060405180830381865afa15801561198e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119b29190614b2e565b11156119ec576119ec6001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216845f6133f7565b5050505050565b611a5560405180610140016040528060608152602001606081526020015f81526020015f81526020015f81526020015f6001600160a01b031681526020015f81526020015f6001600160a01b0316815260200160608152602001606081525090565b8989808060200260200160405190810160405280939291908181526020018383602002808284375f92019190915250505090825250604080516020808a02828101820190935289825290918a918a9182918501908490808284375f9201829052506020808701959095526001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21660a087015260c086018790523060e0870152604080518f870281810188019092528f81529195869550611b8094509192508f918f9182918501908490808284375f81840152601f19601f820116905080830192505050505050508b8b808060200260200160405190810160405280939291908181526020018383602002808284375f92019190915250899250600191506134869050565b91509150632c1c0ba460e01b82604051602401611b9d9190614e81565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526101008401525f80611be38a8a8a8a6139e9565b91509150611bfc82611bf58584613bbb565b885f613486565b5060405190945063fa0f64eb60e01b90611c1a908690602401614e81565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925261012087015285019290925250919b9a5050505050505050505050565b6040516321f8a72160e01b8152600481018290525f907f00000000000000000000000017a332dc7b40ae701485023b219e9d6f493a25146001600160a01b0316906321f8a72190602401602060405180830381865afa158015611cce573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106f79190614b13565b6040516317ea35d960e21b81526001600160a01b037f00000000000000000000000001df6fb6a28a89d6bfa53b2b3f20644abf4176781690635fa8d76490611d4290869086908690600401614fc6565b5f604051808303815f87803b158015611d59575f80fd5b505af1158015611d6b573d5f803e3d5ffd5b50505050505050565b5f6006805480602002602001604051908101604052809291908181526020018280548015611dbf57602002820191905f5260205f20905b815481526020019060010190808311611dab575b5050835186519495509392505f9150505b82811015611e9a575f805b83811015611e2d57868181518110611df557611df5614aff565b6020026020010151868481518110611e0f57611e0f614aff565b602002602001015103611e255760019150611e2d565b600101611ddb565b5080611e9157611e5687868481518110611e4957611e49614aff565b6020026020010151613c6b565b15611e9157848281518110611e6d57611e6d614aff565b602002602001015160405163350085c960e11b815260040161138491815260200190565b50600101611dd0565b5083515f90808203611ebf576040516342c313c360e11b815260040160405180910390fd5b5f816001600160401b03811115611ed857611ed86145f6565b604051908082528060200260200182016040528015611f01578160200160208202803683370190505b5090507f000000000000000000000000d85ec15a9f814d6173bf1a89273bfb3964aadaec5f807f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2815b8681101561217557846001600160a01b031663b5c756978d8381518110611f7357611f73614aff565b60200260200101516040518263ffffffff1660e01b8152600401611f9991815260200190565b602060405180830381865afa158015611fb4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611fd89190614ffb565b612012578b8181518110611fee57611fee614aff565b60200260200101516040516317ed28b560e31b815260040161138491815260200190565b6120278c82815181106115ef576115ef614aff565b90505080945050816001600160a01b0316846001600160a01b031663b60262ca6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612074573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906120989190614b13565b6001600160a01b0316146120bf576040516307397cd760e01b815260040160405180910390fd5b5f6120d68e8e8481518110611e4957611e49614aff565b60405163b7ba28cd60e01b8152600481018290529091506001600160a01b0386169063b7ba28cd90602401602060405180830381865afa15801561211c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906121409190614b2e565b93508387838151811061215557612155614aff565b602090810291909101015261216a848a614fb3565b985050600101611f4a565b505f805b612184600189614b59565b81101561220a576121bd6127108a5f8a85815181106121a5576121a5614aff565b6020026020010151613cd8909392919063ffffffff16565b8782815181106121cf576121cf614aff565b6020026020010181815250508681815181106121ed576121ed614aff565b6020026020010151826122009190614fb3565b9150600101612179565b5061221781612710614b59565b8661222360018a614b59565b8151811061223357612233614aff565b6020026020010181815250508560079080519060200190612255929190614433565b508b516122699060069060208f0190614433565b5060028790556040517fb60570021257b8c021f071d6b761bf920e130dbbd2c819989f690f8337253b88906122a1908e908990614778565b60405180910390a150505050505050505050505050565b5f6122c4600484611270565b9050811515811515146108d45781156122e5576122e083613d33565b6122ee565b6122ee83613d42565b6040805184815283151560208201527ff5b8e2d9dfe40944d8ee0c9b9039acd8516760f92d19ef0f6aba3e0994d7287691016108cb565b60605f61128383613d4d565b5f6123456001600160a01b03841683613da6565b905080515f141580156123695750808060200190518101906123679190614ffb565b155b156108d457604051635274afe760e01b81526001600160a01b0384166004820152602401611384565b61239a61447c565b60065f815481106123ad576123ad614aff565b5f9182526020822001548083526123c390612d28565b505090505f6123f57f00000000000000000000000001df6fb6a28a89d6bfa53b2b3f20644abf417678845f0151613c6b565b60405163b7ba28cd60e01b8152600481018290529091505f906001600160a01b0384169063b7ba28cd90602401602060405180830381865afa15801561243d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906124619190614b2e565b60808501516001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21660209091015284519091505f906124a690613db3565b905080156124e45760808501516001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2166040909101525b81861061250657602085018390526124fc8183613f79565b6040860152612594565b6125108187613f79565b604086810191909152516307c080f960e01b8152600481018790526001600160a01b038516906307c080f990602401602060405180830381865afa15801561255a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061257e9190614b2e565b6020860181905283101561259457602085018390525b50506064606084015250505f60c0820181905260e0820152306101008201819052610120820152919050565b60405163524fca8b60e11b81526001600160a01b03848116600483015260248201849052604482018390527f00000000000000000000000001df6fb6a28a89d6bfa53b2b3f20644abf417678169063a49f951690606401611d42565b6126246144d6565b600254600680546040805160208084028201810190925282815292919083018282801561266e57602002820191905f5260205f20905b81548152602001906001019080831161265a575b505050918452508190506001600160401b0381111561268f5761268f6145f6565b6040519080825280602002602001820160405280156126b8578160200160208202803683370190505b506020830152806001600160401b038111156126d6576126d66145f6565b6040519080825280602002602001820160405280156126ff578160200160208202803683370190505b506060830152806001600160401b0381111561271d5761271d6145f6565b60405190808252806020026020018201604052801561275657816020015b612743614540565b81526020019060019003908161273b5790505b506080830152806001600160401b03811115612774576127746145f6565b60405190808252806020026020018201604052801561279d578160200160208202803683370190505b5060c0830181905260e0830152306101008301819052610120830152806001600160401b038111156127d1576127d16145f6565b6040519080825280602002602001820160405280156127fa578160200160208202803683370190505b5060408301527f00000000000000000000000001df6fb6a28a89d6bfa53b2b3f20644abf4176785f80836001600160401b0381111561283b5761283b6145f6565b604051908082528060200260200182016040528015612864578160200160208202803683370190505b5090505f846001600160401b03811115612880576128806145f6565b6040519080825280602002602001820160405280156128a9578160200160208202803683370190505b5090505f5b858110156129de575f6128cf885f015183815181106115ef576115ef614aff565b505090506128ec86895f01518481518110611e4957611e49614aff565b8483815181106128fe576128fe614aff565b602002602001018181525050806001600160a01b031663b7ba28cd85848151811061292b5761292b614aff565b60200260200101516040518263ffffffff1660e01b815260040161295191815260200190565b602060405180830381865afa15801561296c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906129909190614b2e565b8383815181106129a2576129a2614aff565b6020026020010181815250508282815181106129c0576129c0614aff565b6020026020010151856129d39190614fb3565b9450506001016128ae565b505f5b85811015612d04577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc287608001518281518110612a2057612a20614aff565b6020026020010151602001906001600160a01b031690816001600160a01b0316815250505f612a5d885f015183815181106115ef576115ef614aff565b505090505f612a87895f01518481518110612a7a57612a7a614aff565b6020026020010151613db3565b90508015612aeb577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc289608001518481518110612ac657612ac6614aff565b6020026020010151604001906001600160a01b031690816001600160a01b0316815250505b858a10612b7857848381518110612b0457612b04614aff565b602002602001015189602001518481518110612b2257612b22614aff565b602002602001018181525050612b5181858581518110612b4457612b44614aff565b6020026020010151613f79565b89604001518481518110612b6757612b67614aff565b602002602001018181525050612cd7565b5f612ba460078581548110612b8f57612b8f614aff565b5f9182526020822001548d9161271090613cd8565b9050612bb08282613f79565b8a604001518581518110612bc657612bc6614aff565b60209081029190910101526040516307c080f960e01b8152600481018290526001600160a01b038416906307c080f990602401602060405180830381865afa158015612c14573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612c389190614b2e565b8a602001518581518110612c4e57612c4e614aff565b602002602001018181525050858481518110612c6c57612c6c614aff565b60200260200101518a602001518581518110612c8a57612c8a614aff565b60200260200101511115612cd557858481518110612caa57612caa614aff565b60200260200101518a602001518581518110612cc857612cc8614aff565b6020026020010181815250505b505b606489606001518481518110612cef57612cef614aff565b602090810291909101015250506001016129e1565b505050505050919050565b60608315612d1e575081611283565b6112838383613f90565b8060a081901c60c082901c5f819003612d545760405163030042b760e01b815260040160405180910390fd5b9193909250565b612d636144d6565b6002546006805460408051602080840282018101909252828152929190830182828015612dad57602002820191905f5260205f20905b815481526020019060010190808311612d99575b505050918452508190506001600160401b03811115612dce57612dce6145f6565b604051908082528060200260200182016040528015612df7578160200160208202803683370190505b506020830152806001600160401b03811115612e1557612e156145f6565b604051908082528060200260200182016040528015612e3e578160200160208202803683370190505b506060830152806001600160401b03811115612e5c57612e5c6145f6565b604051908082528060200260200182016040528015612e9557816020015b612e82614540565b815260200190600190039081612e7a5790505b506080830152806001600160401b03811115612eb357612eb36145f6565b604051908082528060200260200182016040528015612edc578160200160208202803683370190505b5060c0830181905260e0830152306101008301819052610120830152806001600160401b03811115612f1057612f106145f6565b604051908082528060200260200182016040528015612f39578160200160208202803683370190505b5060408301525f816001600160401b03811115612f5857612f586145f6565b604051908082528060200260200182016040528015612f8b57816020015b6060815260200190600190039081612f765790505b5090505f6007805480602002602001604051908101604052809291908181526020018280548015612fd957602002820191905f5260205f20905b815481526020019060010190808311612fc5575b505050505090505f5b838110156131d0577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28560800151828151811061302157613021614aff565b6020026020010151602001906001600160a01b031690816001600160a01b0316815250505f61305e865f015183815181106115ef576115ef614aff565b50509050613087865f0151838151811061307a5761307a614aff565b6020026020010151613fba565b84838151811061309957613099614aff565b60200260200101819052506130d68383815181106130b9576130b9614aff565b60200260200101516127105f8a613cd8909392919063ffffffff16565b866020015183815181106130ec576130ec614aff565b602002602001018181525050806001600160a01b03166307c080f98760200151848151811061311d5761311d614aff565b60200260200101516040518263ffffffff1660e01b815260040161314391815260200190565b602060405180830381865afa15801561315e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906131829190614b2e565b8660400151838151811061319857613198614aff565b6020026020010181815250506064866060015183815181106131bc576131bc614aff565b602090810291909101015250600101612fe2565b5082826040516020016131e4929190615061565b60408051601f1981840301815291905261014085015250919392505050565b61320b61447c565b60065f8154811061321e5761321e614aff565b5f91825260208083209091015483528281018490526064606084015260808301516001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21691015260c0820181905260e08201819052306101008301819052610120830152815161329490612d28565b50506040516307c080f960e01b8152600481018590529091506001600160a01b038216906307c080f990602401602060405180830381865afa1580156132dc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906133009190614b2e565b604083015281515f9061331290613fba565b6040805160018082528183019092529192505f9190816020015b606081526020019060019003908161332c57905050905081815f8151811061335657613356614aff565b60200260200101819052506001816040516020016131e4929190615079565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301525f919085169063dd62ed3e90604401602060405180830381865afa1580156133c2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906133e69190614b2e565b905061119d84846133f78585614fb3565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052613448848261404e565b61119d576040516001600160a01b0384811660248301525f604483015261347c91869182169063095ea7b39060640161131f565b61119d8482612331565b61348e614574565b5f6134976144d6565b868152602081018690525f6134cb7fcfa3537c7b7ad87a0dd290c1d493cb256cbf491441572cd66c66c6af6310399b611c69565b8851909150806001600160401b038111156134e8576134e86145f6565b604051908082528060200260200182016040528015613511578160200160208202803683370190505b506040840152806001600160401b0381111561352f5761352f6145f6565b604051908082528060200260200182016040528015613558578160200160208202803683370190505b506060840152806001600160401b03811115613576576135766145f6565b6040519080825280602002602001820160405280156135af57816020015b61359c614540565b8152602001906001900390816135945790505b5060808401525f816001600160401b038111156135ce576135ce6145f6565b60405190808252806020026020018201604052801561360157816020015b60608152602001906001900390816135ec5790505b5090505f5b82811015613944575f6136248c83815181106115ef576115ef614aff565b505090508815613764575f6136448d8481518110612a7a57612a7a614aff565b905080156136a8577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28760800151848151811061368357613683614aff565b6020026020010151604001906001600160a01b031690816001600160a01b0316815250505b5f826001600160a01b031663b7ba28cd8e86815181106136ca576136ca614aff565b60200260200101516040518263ffffffff1660e01b81526004016136f091815260200190565b602060405180830381865afa15801561370b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061372f9190614b2e565b905061373b8282613f79565b8860400151858151811061375157613751614aff565b602002602001018181525050505061383f565b6137798c838151811061307a5761307a614aff565b83838151811061378b5761378b614aff565b6020026020010181905250806001600160a01b03166307c080f98c84815181106137b7576137b7614aff565b60200260200101516040518263ffffffff1660e01b81526004016137dd91815260200190565b602060405180830381865afa1580156137f8573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061381c9190614b2e565b8660400151838151811061383257613832614aff565b6020026020010181815250505b8560400151828151811061385557613855614aff565b6020026020010151876138689190614fb3565b9650898660600151838151811061388157613881614aff565b6020026020010181815250507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2866080015183815181106138c4576138c4614aff565b6020026020010151602001906001600160a01b031690816001600160a01b0316815250507f00000000000000000000000000000000000000000000000000000000000000018660800151838151811061391f5761391f614aff565b60209081029190910101516001600160401b0390911660809091015250600101613606565b50816001600160401b0381111561395d5761395d6145f6565b604051908082528060200260200182016040528015613986578160200160208202803683370190505b5060c0850181905260e08501526001600160a01b03831661010085015230610120850152866139d95781816040516020016139c2929190615061565b60408051601f198184030181529190526101408501525b5050508252909590945092505050565b6060805f83815b81811015613a2d57868682818110613a0a57613a0a614aff565b905060200201355f14613a255782613a2181614bb1565b9350505b6001016139f0565b50816001600160401b03811115613a4657613a466145f6565b604051908082528060200260200182016040528015613a6f578160200160208202803683370190505b509350816001600160401b03811115613a8a57613a8a6145f6565b604051908082528060200260200182016040528015613ab3578160200160208202803683370190505b5092505f805f5b83811015613b8b57888882818110613ad457613ad4614aff565b905060200201355f14613b83578a8a82818110613af357613af3614aff565b90506020020135878481518110613b0c57613b0c614aff565b602002602001018181525050888882818110613b2a57613b2a614aff565b90506020020135868481518110613b4357613b43614aff565b602002602001018181525050888882818110613b6157613b61614aff565b9050602002013582613b739190614fb3565b915082613b7f81614bb1565b9350505b600101613aba565b506127108114613bae576040516314ccf61760e31b815260040160405180910390fd5b5050505094509492505050565b606081516001600160401b03811115613bd657613bd66145f6565b604051908082528060200260200182016040528015613bff578160200160208202803683370190505b5090505f5b8251811015613c6457613c3f838281518110613c2257613c22614aff565b60200260200101516127105f87613cd8909392919063ffffffff16565b828281518110613c5157613c51614aff565b6020908102919091010152600101613c04565b5092915050565b604051627eeac760e11b8152306004820152602481018290525f906001600160a01b0384169062fdd58e90604401602060405180830381865afa158015613cb4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112839190614b2e565b5f80613ce58686866140eb565b90506001836002811115613cfb57613cfb615094565b148015613d1757505f8480613d1257613d126150a8565b868809115b15613d2a57613d27600182614fb3565b90505b95945050505050565b613d3e6004826141d0565b5050565b613d3e6004826141db565b6060815f01805480602002602001604051908101604052809291908181526020018280548015613d9a57602002820191905f5260205f20905b815481526020019060010190808311613d86575b50505050509050919050565b606061128383835f6141e6565b600154604051632ece023360e21b8152600160a01b90910463ffffffff1660048201525f907f000000000000000000000000d85ec15a9f814d6173bf1a89273bfb3964aadaec9082906001600160a01b0383169063bb3808cc90602401602060405180830381865afa158015613e2b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613e4f9190614b13565b90505f613e5b85612d28565b505090505f836001600160a01b031663b85225bb84846001600160a01b03166365cacaa46040518163ffffffff1660e01b8152600401602060405180830381865afa158015613eac573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613ed09190614b13565b604080516001600160a01b0393841660208201529290911690820152606001604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401613f2391815260200190565b602060405180830381865afa158015613f3e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613f629190614b2e565b9050858103613f7057600194505b50505050919050565b5f82613f855781611283565b611283600a83614b59565b815115613fa05781518083602001fd5b8060405162461bcd60e51b815260040161138491906150bc565b60605f613fc683613db3565b613fde5760405180602001604052805f815250614022565b604080516001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2166020820152016040516020818303038152906040525b905082816040516020016140379291906150ce565b604051602081830303815290604052915050919050565b5f805f846001600160a01b0316846040516140699190614f98565b5f604051808303815f865af19150503d805f81146140a2576040519150601f19603f3d011682016040523d82523d5f602084013e6140a7565b606091505b50915091508180156140d15750805115806140d15750808060200190518101906140d19190614ffb565b8015613d2a5750505050506001600160a01b03163b151590565b5f80805f19858709858702925082811083820303915050805f0361412257838281614118576141186150a8565b0492505050611283565b8084116141695760405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b6044820152606401611384565b5f8486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091025f889003889004909101858311909403939093029303949094049190911702949350505050565b5f611283838361427f565b5f61128383836142cb565b60608147101561420b5760405163cd78605960e01b8152306004820152602401611384565b5f80856001600160a01b031684866040516142269190614f98565b5f6040518083038185875af1925050503d805f8114614260576040519150601f19603f3d011682016040523d82523d5f602084013e614265565b606091505b50915091506142758683836143ae565b9695505050505050565b5f8181526001830160205260408120546142c457508154600181810184555f8481526020808220909301849055845484825282860190935260409020919091556106f7565b505f6106f7565b5f81815260018301602052604081205480156143a5575f6142ed600183614b59565b85549091505f9061430090600190614b59565b905081811461435f575f865f01828154811061431e5761431e614aff565b905f5260205f200154905080875f01848154811061433e5761433e614aff565b5f918252602080832090910192909255918252600188019052604090208390555b8554869080614370576143706150e6565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f9055600193505050506106f7565b5f9150506106f7565b6060826143c3576143be8261440a565b611283565b81511580156143da57506001600160a01b0384163b155b1561440357604051639996b31560e01b81526001600160a01b0385166004820152602401611384565b5080611283565b80511561441a5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b828054828255905f5260205f2090810192821561446c579160200282015b8281111561446c578251825591602001919060010190614451565b5061447892915061458c565b5090565b6040518061016001604052805f81526020015f81526020015f81526020015f81526020016144a8614540565b81526060602082018190525f604083018190528183018190526080830181905260a083015260c09091015290565b60405180610160016040528060608152602001606081526020016060815260200160608152602001606081526020016060815260200160608152602001606081526020015f6001600160a01b031681526020015f6001600160a01b03168152602001606081525090565b6040805160c08101825260608082525f6020830181905292820183905281018290526080810182905260a081019190915290565b60405180602001604052806145876144d6565b905290565b5b80821115614478575f815560010161458d565b5f602082840312156145b0575f80fd5b81356001600160e01b031981168114611283575f80fd5b6001600160a01b0381168114610999575f80fd5b5f602082840312156145eb575f80fd5b8135611283816145c7565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715614632576146326145f6565b604052919050565b5f6001600160401b03821115614652576146526145f6565b5060051b60200190565b5f82601f83011261466b575f80fd5b8135602061468061467b8361463a565b61460a565b8083825260208201915060208460051b8701019350868411156146a1575f80fd5b602086015b848110156146bd57803583529183019183016146a6565b509695505050505050565b5f602082840312156146d8575f80fd5b81356001600160401b038111156146ed575f80fd5b610a3d8482850161465c565b602080825282518282018190525f9190848201906040850190845b81811015614732578351151583529284019291840191600101614714565b50909695505050505050565b5f815180845260208085019450602084015f5b8381101561476d57815187529582019590820190600101614751565b509495945050505050565b604081525f61478a604083018561473e565b8281036020840152613d2a818561473e565b5f602082840312156147ac575f80fd5b5035919050565b5f5b838110156147cd5781810151838201526020016147b5565b50505f910152565b5f81518084526147ec8160208601602086016147b3565b601f01601f19169290920160200192915050565b8215158152604060208201525f610a3d60408301846147d5565b5f6020828403121561482a575f80fd5b813563ffffffff81168114611283575f80fd5b5f6020828403121561484d575f80fd5b81356001600160401b03811115614862575f80fd5b820160a08185031215611283575f80fd5b5f8083601f840112614883575f80fd5b5081356001600160401b03811115614899575f80fd5b6020830191508360208260051b85010111156148b3575f80fd5b9250929050565b5f8083601f8401126148ca575f80fd5b5081356001600160401b038111156148e0575f80fd5b6020830191508360208285010111156148b3575f80fd5b5f805f805f805f8060a0898b03121561490e575f80fd5b8835614919816145c7565b97506020890135614929816145c7565b965060408901356001600160401b0380821115614944575f80fd5b6149508c838d01614873565b909850965060608b0135915080821115614968575f80fd5b6149748c838d01614873565b909650945060808b013591508082111561498c575f80fd5b506149998b828c016148ba565b999c989b5096995094979396929594505050565b8015158114610999575f80fd5b5f80604083850312156149cb575f80fd5b82356001600160401b03808211156149e1575f80fd5b6149ed8683870161465c565b9350602091508185013581811115614a03575f80fd5b85019050601f81018613614a15575f80fd5b8035614a2361467b8261463a565b81815260059190911b82018301908381019088831115614a41575f80fd5b928401925b82841015614a68578335614a59816149ad565b82529284019290840190614a46565b80955050505050509250929050565b602081525f611283602083018461473e565b5f805f805f8060a08789031215614a9e575f80fd5b8635614aa9816145c7565b95506020870135614ab9816145c7565b9450604087013593506060870135925060808701356001600160401b03811115614ae1575f80fd5b614aed89828a016148ba565b979a9699509497509295939492505050565b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215614b23575f80fd5b8151611283816145c7565b5f60208284031215614b3e575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b818103818111156106f7576106f7614b45565b5f808335601e19843603018112614b81575f80fd5b8301803591506001600160401b03821115614b9a575f80fd5b6020019150600581901b36038213156148b3575f80fd5b5f60018201614bc257614bc2614b45565b5060010190565b602081525f8251610140806020850152614be761016085018361473e565b91506020850151601f1980868503016040870152614c05848361473e565b93506040870151606087015260608701516080870152608087015160a087015260a08701519150614c4160c08701836001600160a01b03169052565b60c087015160e087015260e08701519150610100614c69818801846001600160a01b03169052565b80880151925050610120818786030181880152614c8685846147d5565b90880151878203909201848801529350905061427583826147d5565b5f815160c08452614cb660c08501826147d5565b9050602083015160018060a01b038082166020870152806040860151166040870152505060ff60608401511660608501526001600160401b03608084015116608085015260a083015160a08501528091505092915050565b602081525f8251602080840152805160408401526020810151606084015260408101516080840152606081015160a084015260808101516101608060c0860152614d5c6101a0860183614ca2565b915060a0830151603f19808785030160e0880152614d7a84836147d5565b935060c08501519150610100614d938189018415159052565b60e08601519250610120614daa818a018515159052565b90860151925061014090614dc8898301856001600160a01b03169052565b8601516001600160a01b03169388019390935291909301518583039091016101808601529150613d2a81836147d5565b5f8282518085526020808601955060208260051b840101602086015f5b84811015614e4357601f19868403018952614e31838351614ca2565b98840198925090830190600101614e15565b5090979650505050505050565b5f815180845260208085019450602084015f5b8381101561476d578151151587529582019590820190600101614e63565b602081525f82516020808401528051610160806040860152614ea76101a086018361473e565b91506020830151603f1980878503016060880152614ec5848361473e565b93506040850151915080878503016080880152614ee2848361473e565b935060608501519150808785030160a0880152614eff848361473e565b935060808501519150808785030160c0880152614f1c8483614df8565b935060a08501519150808785030160e0880152614f3984836147d5565b935060c08501519150610100818886030181890152614f588584614e50565b945060e086015192506101208289870301818a0152614f778685614e50565b95508187015193506101409150614dc8828a01856001600160a01b03169052565b5f8251614fa98184602087016147b3565b9190910192915050565b808201808211156106f7576106f7614b45565b6001600160a01b03841681526060602082018190525f90614fe99083018561473e565b8281036040840152614275818561473e565b5f6020828403121561500b575f80fd5b8151611283816149ad565b5f8282518085526020808601955060208260051b840101602086015f5b84811015614e4357601f1986840301895261504f8383516147d5565b98840198925090830190600101615033565b828152604060208201525f610a3d6040830184615016565b60ff83168152604060208201525f610a3d6040830184615016565b634e487b7160e01b5f52602160045260245ffd5b634e487b7160e01b5f52601260045260245ffd5b602081525f61128360208301846147d5565b828152604060208201525f610a3d60408301846147d5565b634e487b7160e01b5f52603160045260245ffdfea264697066735822122084dc9ef8254b7f2d70223b44c21428352171c4b4b68adb9e9c7c089f7146953b64736f6c63430008180033
Verified Source Code Partial Match
Compiler: v0.8.24+commit.e11b9ed9
EVM: shanghai
Optimization: Yes (200 runs)
SuperVault.sol 6179 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.18 ^0.8.0 ^0.8.1 ^0.8.20 ^0.8.23 ^0.8.24;
// lib/superform-core/lib/ERC1155A/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
/**
* @dev Standard ERC-20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC-721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC-1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}
// lib/superform-core/lib/ERC1155A/lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
// lib/superform-core/lib/ERC1155A/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)
/**
* @dev Interface of the ERC-20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[ERC-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC-20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
// lib/superform-core/lib/ERC1155A/lib/openzeppelin-contracts/contracts/utils/Address.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
/**
* @dev Collection of functions related to the address type
*/
library Address_0 {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}
// lib/superform-core/lib/ERC1155A/lib/openzeppelin-contracts/contracts/utils/Context.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// lib/superform-core/lib/ERC1155A/lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165_0 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// lib/superform-core/src/interfaces/IBaseSuperformRouterPlus.sol
interface IBaseSuperformRouterPlus {
//////////////////////////////////////////////////////////////
// ERRORS //
//////////////////////////////////////////////////////////////
/// @notice thrown if the provided selector is invalid
error INVALID_REBALANCE_SELECTOR();
//////////////////////////////////////////////////////////////
// STRUCTS //
//////////////////////////////////////////////////////////////
struct XChainRebalanceData {
bytes4 rebalanceSelector;
address interimAsset;
uint256 slippage;
uint256 expectedAmountInterimAsset;
uint8[][] rebalanceToAmbIds;
uint64[] rebalanceToDstChainIds;
bytes rebalanceToSfData;
}
//////////////////////////////////////////////////////////////
// ENUMS //
//////////////////////////////////////////////////////////////
enum Actions {
DEPOSIT,
REBALANCE_FROM_SINGLE,
REBALANCE_FROM_MULTI,
REBALANCE_X_CHAIN_FROM_SINGLE,
REBALANCE_X_CHAIN_FROM_MULTI
}
}
// lib/superform-core/src/interfaces/ISuperRegistry.sol
/// @title ISuperRegistry
/// @dev Interface for SuperRegistry
/// @author Zeropoint Labs
interface ISuperRegistry {
//////////////////////////////////////////////////////////////
// EVENTS //
//////////////////////////////////////////////////////////////
/// @dev emitted when permit2 is set.
event SetPermit2(address indexed permit2);
/// @dev is emitted when an address is set.
event AddressUpdated(
bytes32 indexed protocolAddressId, uint64 indexed chainId, address indexed oldAddress, address newAddress
);
/// @dev is emitted when a new token bridge is configured.
event SetBridgeAddress(uint256 indexed bridgeId, address indexed bridgeAddress);
/// @dev is emitted when a new bridge validator is configured.
event SetBridgeValidator(uint256 indexed bridgeId, address indexed bridgeValidator);
/// @dev is emitted when a new amb is configured.
event SetAmbAddress(uint8 indexed ambId_, address indexed ambAddress_, bool indexed isBroadcastAMB_);
/// @dev is emitted when a new state registry is configured.
event SetStateRegistryAddress(uint8 indexed registryId_, address indexed registryAddress_);
/// @dev is emitted when a new delay is configured.
event SetDelay(uint256 indexed oldDelay_, uint256 indexed newDelay_);
/// @dev is emitted when a new vault limit is configured
event SetVaultLimitPerDestination(uint64 indexed chainId_, uint256 indexed vaultLimit_);
//////////////////////////////////////////////////////////////
// EXTERNAL VIEW FUNCTIONS //
//////////////////////////////////////////////////////////////
/// @dev gets the deposit rescue delay
function delay() external view returns (uint256);
/// @dev returns the permit2 address
function PERMIT2() external view returns (address);
/// @dev returns the id of the superform router module
function SUPERFORM_ROUTER() external view returns (bytes32);
/// @dev returns the id of the superform factory module
function SUPERFORM_FACTORY() external view returns (bytes32);
/// @dev returns the id of the superform paymaster contract
function PAYMASTER() external view returns (bytes32);
/// @dev returns the id of the superform payload helper contract
function PAYMENT_HELPER() external view returns (bytes32);
/// @dev returns the id of the core state registry module
function CORE_STATE_REGISTRY() external view returns (bytes32);
/// @dev returns the id of the timelock form state registry module
function TIMELOCK_STATE_REGISTRY() external view returns (bytes32);
/// @dev returns the id of the broadcast state registry module
function BROADCAST_REGISTRY() external view returns (bytes32);
/// @dev returns the id of the super positions module
function SUPER_POSITIONS() external view returns (bytes32);
/// @dev returns the id of the super rbac module
function SUPER_RBAC() external view returns (bytes32);
/// @dev returns the id of the payload helper module
function PAYLOAD_HELPER() external view returns (bytes32);
/// @dev returns the id of the dst swapper keeper
function DST_SWAPPER() external view returns (bytes32);
/// @dev returns the id of the emergency queue
function EMERGENCY_QUEUE() external view returns (bytes32);
/// @dev returns the id of the superform receiver
function SUPERFORM_RECEIVER() external view returns (bytes32);
/// @dev returns the id of the payment admin keeper
function PAYMENT_ADMIN() external view returns (bytes32);
/// @dev returns the id of the core state registry processor keeper
function CORE_REGISTRY_PROCESSOR() external view returns (bytes32);
/// @dev returns the id of the broadcast registry processor keeper
function BROADCAST_REGISTRY_PROCESSOR() external view returns (bytes32);
/// @dev returns the id of the timelock form state registry processor keeper
function TIMELOCK_REGISTRY_PROCESSOR() external view returns (bytes32);
/// @dev returns the id of the core state registry updater keeper
function CORE_REGISTRY_UPDATER() external view returns (bytes32);
/// @dev returns the id of the core state registry updater keeper
function CORE_REGISTRY_RESCUER() external view returns (bytes32);
/// @dev returns the id of the core state registry updater keeper
function CORE_REGISTRY_DISPUTER() external view returns (bytes32);
/// @dev returns the id of the core state registry updater keeper
function DST_SWAPPER_PROCESSOR() external view returns (bytes32);
/// @dev gets the address of a contract on current chain
/// @param id_ is the id of the contract
function getAddress(bytes32 id_) external view returns (address);
/// @dev gets the address of a contract on a target chain
/// @param id_ is the id of the contract
/// @param chainId_ is the chain id of that chain
function getAddressByChainId(bytes32 id_, uint64 chainId_) external view returns (address);
/// @dev gets the address of a bridge
/// @param bridgeId_ is the id of a bridge
/// @return bridgeAddress_ is the address of the form
function getBridgeAddress(uint8 bridgeId_) external view returns (address bridgeAddress_);
/// @dev gets the address of a bridge validator
/// @param bridgeId_ is the id of a bridge
/// @return bridgeValidator_ is the address of the form
function getBridgeValidator(uint8 bridgeId_) external view returns (address bridgeValidator_);
/// @dev gets the address of a amb
/// @param ambId_ is the id of a bridge
/// @return ambAddress_ is the address of the form
function getAmbAddress(uint8 ambId_) external view returns (address ambAddress_);
/// @dev gets the id of the amb
/// @param ambAddress_ is the address of an amb
/// @return ambId_ is the identifier of an amb
function getAmbId(address ambAddress_) external view returns (uint8 ambId_);
/// @dev gets the address of the registry
/// @param registryId_ is the id of the state registry
/// @return registryAddress_ is the address of the state registry
function getStateRegistry(uint8 registryId_) external view returns (address registryAddress_);
/// @dev gets the id of the registry
/// @notice reverts if the id is not found
/// @param registryAddress_ is the address of the state registry
/// @return registryId_ is the id of the state registry
function getStateRegistryId(address registryAddress_) external view returns (uint8 registryId_);
/// @dev gets the safe vault limit
/// @param chainId_ is the id of the remote chain
/// @return vaultLimitPerDestination_ is the safe number of vaults to deposit
/// without hitting out of gas error
function getVaultLimitPerDestination(uint64 chainId_) external view returns (uint256 vaultLimitPerDestination_);
/// @dev helps validate if an address is a valid state registry
/// @param registryAddress_ is the address of the state registry
/// @return valid_ a flag indicating if its valid.
function isValidStateRegistry(address registryAddress_) external view returns (bool valid_);
/// @dev helps validate if an address is a valid amb implementation
/// @param ambAddress_ is the address of the amb implementation
/// @return valid_ a flag indicating if its valid.
function isValidAmbImpl(address ambAddress_) external view returns (bool valid_);
/// @dev helps validate if an address is a valid broadcast amb implementation
/// @param ambAddress_ is the address of the broadcast amb implementation
/// @return valid_ a flag indicating if its valid.
function isValidBroadcastAmbImpl(address ambAddress_) external view returns (bool valid_);
//////////////////////////////////////////////////////////////
// EXTERNAL WRITE FUNCTIONS //
//////////////////////////////////////////////////////////////
/// @dev sets the deposit rescue delay
/// @param delay_ the delay in seconds before the deposit rescue can be finalized
function setDelay(uint256 delay_) external;
/// @dev sets the permit2 address
/// @param permit2_ the address of the permit2 contract
function setPermit2(address permit2_) external;
/// @dev sets the safe vault limit
/// @param chainId_ is the remote chain identifier
/// @param vaultLimit_ is the max limit of vaults per transaction
function setVaultLimitPerDestination(uint64 chainId_, uint256 vaultLimit_) external;
/// @dev sets new addresses on specific chains.
/// @param ids_ are the identifiers of the address on that chain
/// @param newAddresses_ are the new addresses on that chain
/// @param chainIds_ are the chain ids of that chain
function batchSetAddress(
bytes32[] calldata ids_,
address[] calldata newAddresses_,
uint64[] calldata chainIds_
)
external;
/// @dev sets a new address on a specific chain.
/// @param id_ the identifier of the address on that chain
/// @param newAddress_ the new address on that chain
/// @param chainId_ the chain id of that chain
function setAddress(bytes32 id_, address newAddress_, uint64 chainId_) external;
/// @dev allows admin to set the bridge address for an bridge id.
/// @notice this function operates in an APPEND-ONLY fashion.
/// @param bridgeId_ represents the bridge unique identifier.
/// @param bridgeAddress_ represents the bridge address.
/// @param bridgeValidator_ represents the bridge validator address.
function setBridgeAddresses(
uint8[] memory bridgeId_,
address[] memory bridgeAddress_,
address[] memory bridgeValidator_
)
external;
/// @dev allows admin to set the amb address for an amb id.
/// @notice this function operates in an APPEND-ONLY fashion.
/// @param ambId_ represents the bridge unique identifier.
/// @param ambAddress_ represents the bridge address.
/// @param isBroadcastAMB_ represents whether the amb implementation supports broadcasting
function setAmbAddress(
uint8[] memory ambId_,
address[] memory ambAddress_,
bool[] memory isBroadcastAMB_
)
external;
/// @dev allows admin to set the state registry address for an state registry id.
/// @notice this function operates in an APPEND-ONLY fashion.
/// @param registryId_ represents the state registry's unique identifier.
/// @param registryAddress_ represents the state registry's address.
function setStateRegistryAddress(uint8[] memory registryId_, address[] memory registryAddress_) external;
}
// lib/superform-core/src/interfaces/ISuperformFactory.sol
/// @title ISuperformFactory
/// @dev Interface for SuperformFactory
/// @author ZeroPoint Labs
interface ISuperformFactory {
//////////////////////////////////////////////////////////////
// CONSTANTS //
//////////////////////////////////////////////////////////////
enum PauseStatus {
NON_PAUSED,
PAUSED
}
//////////////////////////////////////////////////////////////
// EVENTS //
//////////////////////////////////////////////////////////////
/// @dev emitted when a new formImplementation is entered into the factory
/// @param formImplementation is the address of the new form implementation
/// @param formImplementationId is the id of the formImplementation
/// @param formStateRegistryId is any additional state registry id of the formImplementation
event FormImplementationAdded(
address indexed formImplementation, uint256 indexed formImplementationId, uint8 indexed formStateRegistryId
);
/// @dev emitted when a new Superform is created
/// @param formImplementationId is the id of the form implementation
/// @param vault is the address of the vault
/// @param superformId is the id of the superform
/// @param superform is the address of the superform
event SuperformCreated(
uint256 indexed formImplementationId, address indexed vault, uint256 indexed superformId, address superform
);
/// @dev emitted when a new SuperRegistry is set
/// @param superRegistry is the address of the super registry
event SuperRegistrySet(address indexed superRegistry);
/// @dev emitted when a form implementation is paused
/// @param formImplementationId is the id of the form implementation
/// @param paused is the new paused status
event FormImplementationPaused(uint256 indexed formImplementationId, PauseStatus indexed paused);
//////////////////////////////////////////////////////////////
// EXTERNAL VIEW FUNCTIONS //
//////////////////////////////////////////////////////////////
/// @dev returns the number of forms
/// @return forms_ is the number of forms
function getFormCount() external view returns (uint256 forms_);
/// @dev returns the number of superforms
/// @return superforms_ is the number of superforms
function getSuperformCount() external view returns (uint256 superforms_);
/// @dev returns the address of a form implementation
/// @param formImplementationId_ is the id of the form implementation
/// @return formImplementation_ is the address of the form implementation
function getFormImplementation(uint32 formImplementationId_) external view returns (address formImplementation_);
/// @dev returns the form state registry id of a form implementation
/// @param formImplementationId_ is the id of the form implementation
/// @return stateRegistryId_ is the additional state registry id of the form
function getFormStateRegistryId(uint32 formImplementationId_) external view returns (uint8 stateRegistryId_);
/// @dev returns the paused status of form implementation
/// @param formImplementationId_ is the id of the form implementation
/// @return paused_ is the current paused status of the form formImplementationId_
function isFormImplementationPaused(uint32 formImplementationId_) external view returns (bool paused_);
/// @dev returns the address of a superform
/// @param superformId_ is the id of the superform
/// @return superform_ is the address of the superform
/// @return formImplementationId_ is the id of the form implementation
/// @return chainId_ is the chain id
function getSuperform(uint256 superformId_)
external
pure
returns (address superform_, uint32 formImplementationId_, uint64 chainId_);
/// @dev returns if an address has been added to a Form
/// @param superformId_ is the id of the superform
/// @return isSuperform_ bool if it exists
function isSuperform(uint256 superformId_) external view returns (bool isSuperform_);
/// @dev Reverse query of getSuperform, returns all superforms for a given vault
/// @param vault_ is the address of a vault
/// @return superformIds_ is the id of the superform
/// @return superforms_ is the address of the superform
function getAllSuperformsFromVault(address vault_)
external
view
returns (uint256[] memory superformIds_, address[] memory superforms_);
//////////////////////////////////////////////////////////////
// EXTERNAL WRITE FUNCTIONS //
//////////////////////////////////////////////////////////////
/// @dev allows an admin to add a Form implementation to the factory
/// @param formImplementation_ is the address of a form implementation
/// @param formImplementationId_ is the id of the form implementation (generated off-chain and equal in all chains)
/// @param formStateRegistryId_ is the id of any additional state registry for that form
/// @dev formStateRegistryId_ 1 is default for all form implementations, pass in formStateRegistryId_ only if an
/// additional state registry is required
function addFormImplementation(
address formImplementation_,
uint32 formImplementationId_,
uint8 formStateRegistryId_
)
external;
/// @dev To add new vaults to Form implementations, fusing them together into Superforms
/// @param formImplementationId_ is the form implementation we want to attach the vault to
/// @param vault_ is the address of the vault
/// @return superformId_ is the id of the created superform
/// @return superform_ is the address of the created superform
function createSuperform(
uint32 formImplementationId_,
address vault_
)
external
returns (uint256 superformId_, address superform_);
/// @dev to synchronize superforms added to different chains using broadcast registry
/// @param data_ is the cross-chain superform id
function stateSyncBroadcast(bytes memory data_) external payable;
/// @dev allows an admin to change the status of a form
/// @param formImplementationId_ is the id of the form implementation
/// @param status_ is the new status
/// @param extraData_ is optional & passed when broadcasting of status is needed
function changeFormImplementationPauseStatus(
uint32 formImplementationId_,
PauseStatus status_,
bytes memory extraData_
)
external
payable;
}
// lib/superform-core/src/libraries/Error.sol
library Error {
//////////////////////////////////////////////////////////////
// CONFIGURATION ERRORS //
//////////////////////////////////////////////////////////////
///@notice errors thrown in protocol setup
/// @dev thrown if chain id exceeds max(uint64)
error BLOCK_CHAIN_ID_OUT_OF_BOUNDS();
/// @dev thrown if not possible to revoke a role in broadcasting
error CANNOT_REVOKE_NON_BROADCASTABLE_ROLES();
/// @dev thrown if not possible to revoke last admin
error CANNOT_REVOKE_LAST_ADMIN();
/// @dev thrown if trying to set again pseudo immutables in super registry
error DISABLED();
/// @dev thrown if rescue delay is not yet set for a chain
error DELAY_NOT_SET();
/// @dev thrown if get native token price estimate in paymentHelper is 0
error INVALID_NATIVE_TOKEN_PRICE();
/// @dev thrown if wormhole refund chain id is not set
error REFUND_CHAIN_ID_NOT_SET();
/// @dev thrown if wormhole relayer is not set
error RELAYER_NOT_SET();
/// @dev thrown if a role to be revoked is not assigned
error ROLE_NOT_ASSIGNED();
//////////////////////////////////////////////////////////////
// AUTHORIZATION ERRORS //
//////////////////////////////////////////////////////////////
///@notice errors thrown if functions cannot be called
/// COMMON AUTHORIZATION ERRORS
/// ---------------------------------------------------------
/// @dev thrown if caller is not address(this), internal call
error INVALID_INTERNAL_CALL();
/// @dev thrown if msg.sender is not a valid amb implementation
error NOT_AMB_IMPLEMENTATION();
/// @dev thrown if msg.sender is not an allowed broadcaster
error NOT_ALLOWED_BROADCASTER();
/// @dev thrown if msg.sender is not broadcast amb implementation
error NOT_BROADCAST_AMB_IMPLEMENTATION();
/// @dev thrown if msg.sender is not broadcast state registry
error NOT_BROADCAST_REGISTRY();
/// @dev thrown if msg.sender is not core state registry
error NOT_CORE_STATE_REGISTRY();
/// @dev thrown if msg.sender is not emergency admin
error NOT_EMERGENCY_ADMIN();
/// @dev thrown if msg.sender is not emergency queue
error NOT_EMERGENCY_QUEUE();
/// @dev thrown if msg.sender is not minter
error NOT_MINTER();
/// @dev thrown if msg.sender is not minter state registry
error NOT_MINTER_STATE_REGISTRY_ROLE();
/// @dev thrown if msg.sender is not paymaster
error NOT_PAYMASTER();
/// @dev thrown if msg.sender is not payment admin
error NOT_PAYMENT_ADMIN();
/// @dev thrown if msg.sender is not protocol admin
error NOT_PROTOCOL_ADMIN();
/// @dev thrown if msg.sender is not state registry
error NOT_STATE_REGISTRY();
/// @dev thrown if msg.sender is not super registry
error NOT_SUPER_REGISTRY();
/// @dev thrown if msg.sender is not superform router
error NOT_SUPERFORM_ROUTER();
/// @dev thrown if msg.sender is not a superform
error NOT_SUPERFORM();
/// @dev thrown if msg.sender is not superform factory
error NOT_SUPERFORM_FACTORY();
/// @dev thrown if msg.sender is not timelock form
error NOT_TIMELOCK_SUPERFORM();
/// @dev thrown if msg.sender is not timelock state registry
error NOT_TIMELOCK_STATE_REGISTRY();
/// @dev thrown if msg.sender is not user or disputer
error NOT_VALID_DISPUTER();
/// @dev thrown if the msg.sender is not privileged caller
error NOT_PRIVILEGED_CALLER(bytes32 role);
/// STATE REGISTRY AUTHORIZATION ERRORS
/// ---------------------------------------------------------
/// @dev layerzero adapter specific error, thrown if caller not layerzero endpoint
error CALLER_NOT_ENDPOINT();
/// @dev hyperlane adapter specific error, thrown if caller not hyperlane mailbox
error CALLER_NOT_MAILBOX();
/// @dev wormhole relayer specific error, thrown if caller not wormhole relayer
error CALLER_NOT_RELAYER();
/// @dev thrown if src chain sender is not valid
error INVALID_SRC_SENDER();
//////////////////////////////////////////////////////////////
// INPUT VALIDATION ERRORS //
//////////////////////////////////////////////////////////////
///@notice errors thrown if input variables are not valid
/// COMMON INPUT VALIDATION ERRORS
/// ---------------------------------------------------------
/// @dev thrown if there is an array length mismatch
error ARRAY_LENGTH_MISMATCH();
/// @dev thrown if payload id does not exist
error INVALID_PAYLOAD_ID();
/// @dev error thrown when msg value should be zero in certain payable functions
error MSG_VALUE_NOT_ZERO();
/// @dev thrown if amb ids length is 0
error ZERO_AMB_ID_LENGTH();
/// @dev thrown if address input is address 0
error ZERO_ADDRESS();
/// @dev thrown if amount input is 0
error ZERO_AMOUNT();
/// @dev thrown if final token is address 0
error ZERO_FINAL_TOKEN();
/// @dev thrown if value input is 0
error ZERO_INPUT_VALUE();
/// SUPERFORM ROUTER INPUT VALIDATION ERRORS
/// ---------------------------------------------------------
/// @dev thrown if the vaults data is invalid
error INVALID_SUPERFORMS_DATA();
/// @dev thrown if receiver address is not set
error RECEIVER_ADDRESS_NOT_SET();
/// SUPERFORM FACTORY INPUT VALIDATION ERRORS
/// ---------------------------------------------------------
/// @dev thrown if a form is not ERC165 compatible
error ERC165_UNSUPPORTED();
/// @dev thrown if a form is not form interface compatible
error FORM_INTERFACE_UNSUPPORTED();
/// @dev error thrown if form implementation address already exists
error FORM_IMPLEMENTATION_ALREADY_EXISTS();
/// @dev error thrown if form implementation id already exists
error FORM_IMPLEMENTATION_ID_ALREADY_EXISTS();
/// @dev thrown if a form does not exist
error FORM_DOES_NOT_EXIST();
/// @dev thrown if form id is larger than max uint16
error INVALID_FORM_ID();
/// @dev thrown if superform not on factory
error SUPERFORM_ID_NONEXISTENT();
/// @dev thrown if same vault and form implementation is used to create new superform
error VAULT_FORM_IMPLEMENTATION_COMBINATION_EXISTS();
/// FORM INPUT VALIDATION ERRORS
/// ---------------------------------------------------------
/// @dev thrown if in case of no txData, if liqData.token != vault.asset()
/// in case of txData, if token output of swap != vault.asset()
error DIFFERENT_TOKENS();
/// @dev thrown if the amount in direct withdraw is not correct
error DIRECT_WITHDRAW_INVALID_LIQ_REQUEST();
/// @dev thrown if the amount in xchain withdraw is not correct
error XCHAIN_WITHDRAW_INVALID_LIQ_REQUEST();
/// LIQUIDITY BRIDGE INPUT VALIDATION ERRORS
/// ---------------------------------------------------------
/// @dev thrown if route id is blacklisted in socket
error BLACKLISTED_ROUTE_ID();
/// @dev thrown if route id is not blacklisted in socket
error NOT_BLACKLISTED_ROUTE_ID();
/// @dev error thrown when txData selector of lifi bridge is a blacklisted selector
error BLACKLISTED_SELECTOR();
/// @dev error thrown when txData selector of lifi bridge is not a blacklisted selector
error NOT_BLACKLISTED_SELECTOR();
/// @dev thrown if a certain action of the user is not allowed given the txData provided
error INVALID_ACTION();
/// @dev thrown if in deposits, the liqDstChainId doesn't match the stateReq dstChainId
error INVALID_DEPOSIT_LIQ_DST_CHAIN_ID();
/// @dev thrown if index is invalid
error INVALID_INDEX();
/// @dev thrown if the chain id in the txdata is invalid
error INVALID_TXDATA_CHAIN_ID();
/// @dev thrown if the validation of bridge txData fails due to a destination call present
error INVALID_TXDATA_NO_DESTINATIONCALL_ALLOWED();
/// @dev thrown if the validation of bridge txData fails due to wrong receiver
error INVALID_TXDATA_RECEIVER();
/// @dev thrown if the validation of bridge txData fails due to wrong...
// [truncated — 253308 bytes total]
Read Contract
CHAIN_ID 0x85e1f4d0 → uint64
ERC5115FormImplementationId 0xca70baa3 → uint32
availableDepositLimit 0x46aa2f12 → uint256
availableWithdrawLimit 0x04bd4629 → uint256
depositLimit 0xecf70858 → uint256
getIsWhitelisted 0x10bc7abf → bool[]
getSuperVaultData 0x35ad30b5 → uint256[], uint256[]
getWhitelist 0xd01f63f5 → uint256[]
numberOfSuperforms 0xd65ba11a → uint256
onERC1155BatchReceived 0xbc197c81 → bytes4
onERC1155Received 0xf23a6e61 → bytes4
strategist 0x1fe4a686 → address
superRegistry 0x24c73dda → address
superformFactory 0x34c041a5 → address
superformIds 0x77ca76b8 → uint256
supportsInterface 0x01ffc9a7 → bool
tendTrigger 0x5d265d3f → bool, bytes
tokenizedStrategyAddress 0xd19a3bb8 → address
vaultManager 0x8a4adf24 → address
weights 0xb5f163ff → uint256
Write Contract 12 functions
These functions modify contract state and require a wallet transaction to execute.
deployFunds 0x503160d9
uint256 _amount
forwardDustToPaymaster 0x18354273
No parameters
freeFunds 0x3d6cb575
uint256 _amount
harvestAndReport 0x49317f1d
No parameters
returns: uint256
rebalance 0x43e25790
tuple rebalanceArgs_
setDepositLimit 0xbdc8144b
uint256 depositLimit_
setStrategist 0xc7b9d530
address strategist_
setValid5115FormImplementationId 0x81cd6377
uint32 formImplementationId_
setVaultManager 0xb543503e
address vaultManager_
setWhitelist 0xc04dad5d
uint256[] superformIds_
bool[] isWhitelisted_
shutdownWithdraw 0xfde813a8
uint256 _amount
tendThis 0x9d7fb70c
uint256 _totalIdle
Recent Transactions
No transactions found for this address