Address Contract Partially Verified
Address
0xeFB163B2beA5F631Ab4A55E0B0d62ece5E22304A
Balance
0 ETH
Nonce
1
Code Size
9670 bytes
Creator
0x980d9FbB...f33f at tx 0x734e632c...d06c04
Indexed Transactions
0
Contract Bytecode
9670 bytes
0x608060405234801561000f575f5ffd5b5060043610610281575f3560e01c80638da5cb5b11610156578063c63d75b6116100ca578063e30c397811610084578063e30c3978146105a4578063ef8b30f7146102eb578063f2fde38b146105b5578063f5591714146105c8578063f8068bbe146105db578063fa2af9da146105fa575f5ffd5b8063c63d75b6146103c3578063c6e6f592146102eb578063ce96cb7714610535578063d7f5870314610548578063d905777e14610559578063dd62ed3e1461056c575f5ffd5b8063ada4ef301161011b578063ada4ef30146104b7578063b3d7f6b9146104ca578063b460af94146104dd578063b89c79ed146104f0578063ba0876521461050f578063c4aa09d314610522575f5ffd5b80638da5cb5b1461046557806394bf804d1461047657806395d89b4114610489578063a9059cbb14610491578063aa0b5988146104a4575f5ffd5b806338d52e0f116101f85780636e553f65116101b25780636e553f651461040857806370a082311461041b578063715018a61461042e57806379ba5097146104365780637bc862b51461043e5780638456cb591461045d575f5ffd5b806338d52e0f1461037f5780633f4ba83a146103b9578063402d267d146103c3578063489aa033146103d75780634cdad506146102b55780635c975abb146103f6575f5ffd5b806311ebc6191161024957806311ebc619146102fe57806318160ddd14610306578063189212f01461030e57806323b872dd1461034957806326232a2e1461035c578063313ce56714610365575f5ffd5b806301e1d1141461028557806306fdde03146102a057806307a2d13a146102b5578063095ea7b3146102c85780630a28a477146102eb575b5f5ffd5b61028d61060d565b6040519081526020015b60405180910390f35b6102a861069c565b60405161029791906122af565b61028d6102c33660046122e4565b61072c565b6102db6102d636600461230f565b61073d565b6040519015158152602001610297565b61028d6102f93660046122e4565b610754565b61028d61075f565b61028d61095c565b61032161031c366004612339565b610b89565b604080519586526020860194909452928401919091526060830152608082015260a001610297565b6102db610357366004612354565b610c8d565b61028d60085481565b61036d610ccd565b60405160ff9091168152602001610297565b7f00000000000000000000000072ec8447074dc0bfbedfb516cc250b525f3a4aba5b6040516001600160a01b039091168152602001610297565b6103c1610cf8565b005b61028d6103d1366004612339565b505f1990565b61028d6103e5366004612339565b600a6020525f908152604090205481565b600754600160a01b900460ff166102db565b61028d610416366004612392565b610d0a565b61028d610429366004612339565b610dc2565b6103c1610fbf565b6103c1610fd0565b61028d61044c366004612339565b600b6020525f908152604090205481565b6103c161104a565b6005546001600160a01b03166103a1565b61028d610484366004612392565b61105a565b6102a8611099565b6102db61049f36600461230f565b6110a8565b6103c16104b23660046122e4565b6110da565b6103c16104c5366004612339565b6110e7565b61028d6104d83660046122e4565b611111565b61028d6104eb3660046123c0565b61111d565b61028d6104fe366004612339565b600d6020525f908152604090205481565b61028d61051d3660046123c0565b6112e4565b6103c1610530366004612339565b611325565b61028d610543366004612339565b61138b565b6007546001600160a01b03166103a1565b61028d610567366004612339565b61139f565b61028d61057a3660046123ff565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b6006546001600160a01b03166103a1565b6103c16105c3366004612339565b6113a9565b6103c16105d6366004612339565b61141a565b61028d6105e9366004612339565b600c6020525f908152604090205481565b6009546103a1906001600160a01b031681565b5f7f00000000000000000000000072ec8447074dc0bfbedfb516cc250b525f3a4aba6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015610673573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610697919061242b565b905090565b6060600380546106ab90612442565b80601f01602080910402602001604051908101604052809291908181526020018280546106d790612442565b80156107225780601f106106f957610100808354040283529160200191610722565b820191905f5260205f20905b81548152906001019060200180831161070557829003601f168201915b5050505050905090565b5f610737825f61149f565b92915050565b5f3361074a8185856114c3565b5060019392505050565b5f610737825f6114d5565b5f807f00000000000000000000000072ec8447074dc0bfbedfb516cc250b525f3a4aba6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107bd573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107e1919061242b565b90505f81116108205760405162461bcd60e51b81526020600482015260066024820152652ba0ba3b181960d11b60448201526064015b60405180910390fd5b807f00000000000000000000000072ec8447074dc0bfbedfb516cc250b525f3a4aba6001600160a01b031663c9bca6366040518163ffffffff1660e01b8152600401602060405180830381865afa15801561087d573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108a1919061247a565b6001600160a01b0316639555aa0a7f00000000000000000000000072ec8447074dc0bfbedfb516cc250b525f3a4aba6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610912573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610936919061242b565b61094c906b033b2e3c9fd0803ce80000006124a9565b61095691906124d4565b91505090565b5f807f00000000000000000000000072ec8447074dc0bfbedfb516cc250b525f3a4aba6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109ba573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109de919061242b565b9050807f00000000000000000000000072ec8447074dc0bfbedfb516cc250b525f3a4aba6001600160a01b031663c9bca6366040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a3d573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a61919061247a565b6001600160a01b0316639555aa0a7f00000000000000000000000072ec8447074dc0bfbedfb516cc250b525f3a4aba6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610ad2573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610af6919061242b565b7f00000000000000000000000072ec8447074dc0bfbedfb516cc250b525f3a4aba6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015610b5b573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b7f919061242b565b61094c91906124a9565b5f5f5f5f5f5f5f610b9861075f565b6001600160a01b0389165f908152600a602052604081205491925090610bbe90826114d5565b6001600160a01b038a165f908152600d602052604081205491925090610be490836124e7565b6001600160a01b038b165f908152600c60205260409020549091508110801590610c2457506001600160a01b038a165f908152600b602052604090205483115b15610c52576001600160a01b038a165f908152600c6020526040902054610c4b90826124fa565b9350610c56565b5f93505b506001600160a01b03989098165f908152600d6020908152604080832054600c909252909120549299919897509550909350915050565b5f33610c9a8582856114f9565b5f610ca684600161149f565b9050610cb3868686611575565b610cbf868686846115d2565b6001925050505b9392505050565b5f610697817f000000000000000000000000000000000000000000000000000000000000001261250d565b610d006116d7565b610d08611731565b565b5f610d13611786565b5f8311610d4b5760405162461bcd60e51b815260206004820152600660248201526557417476303360d01b6044820152606401610817565b5f19610d56836117b1565b5f610d6085610754565b90505f8111610d9a5760405162461bcd60e51b815260206004820152600660248201526515d05d1d8c0d60d21b6044820152606401610817565b610da484826117e6565b610dae8486611816565b610dba338587846119a6565b949350505050565b5f5f610dcc61075f565b6001600160a01b0384165f908152600a60205260409020549091501580610df1575080155b15610dfe57505f92915050565b7f00000000000000000000000072ec8447074dc0bfbedfb516cc250b525f3a4aba6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e5a573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e7e919061242b565b7f00000000000000000000000072ec8447074dc0bfbedfb516cc250b525f3a4aba6001600160a01b031663c9bca6366040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eda573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610efe919061247a565b6001600160a01b0316639555aa0a7f00000000000000000000000072ec8447074dc0bfbedfb516cc250b525f3a4aba6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610f6f573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f93919061242b565b6001600160a01b0385165f908152600a6020526040902054610fb591906124a9565b610cc691906124d4565b610fc76116d7565b610d085f611a2a565b60065433906001600160a01b0316811461103e5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152608401610817565b61104781611a2a565b50565b6110526116d7565b610d08611a43565b60405162461bcd60e51b81526020600482015260126024820152711b5a5b9d0a0a481a5cc8191a5cd8589b195960721b60448201525f90606401610817565b6060600480546106ab90612442565b5f33816110b684600161149f565b90506110c3828686611575565b6110cf338686846115d2565b506001949350505050565b6110e26116d7565b600855565b6110ef6116d7565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b5f61073782600161149f565b5f336001600160a01b03831614801561113e57506001600160a01b03831633145b6111735760405162461bcd60e51b815260206004820152600660248201526557417476303560d01b6044820152606401610817565b5f61117d8361138b565b9050808511156111b957604051633fa733bb60e21b81526001600160a01b03841660048201526024810186905260448101829052606401610817565b5f6111c261075f565b90506111cd846117b1565b5f6111d787610754565b90505f612710600854896111eb91906124a9565b6111f591906124d4565b905061120181896124fa565b97505f8111801561121c57506009546001600160a01b031615155b1561126357600954611263906001600160a01b0316827f00000000000000000000000072ec8447074dc0bfbedfb516cc250b525f3a4aba6001600160a01b03169190611a86565b6112703388888b86611ae9565b335f908152600a6020526040812080548a929061128e9084906124fa565b9091555061129e90503383611ba9565b604080518381526020810185905233917f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc6910160405180910390a2509695505050505050565b60405162461bcd60e51b81526020600482015260146024820152731c995919595b4a0a481a5cc8191a5cd8589b195960621b60448201525f90606401610817565b61132d611bd0565b6001600160a01b0381166113695760405162461bcd60e51b815260206004820152600360248201526227a22d60e91b6044820152606401610817565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b5f61073761139883610dc2565b600161149f565b5f61073782610dc2565b6113b1611bd0565b600680546001600160a01b0383166001600160a01b031990911681179091556113e26005546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6114226116d7565b6040516370a0823160e01b81523060048201526110479033906001600160a01b038416906370a0823190602401602060405180830381865afa15801561146a573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061148e919061242b565b6001600160a01b0384169190611a86565b5f5f6114a961075f565b9050610dba846b033b2e3c9fd0803ce80000008386611c0f565b6114d08383836001611c5a565b505050565b5f5f6114df61075f565b9050610dba81856b033b2e3c9fd0803ce800000086611c0f565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f1981101561156f578181101561156157604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610817565b61156f84848484035f611c5a565b50505050565b6001600160a01b03831661159e57604051634b637e8f60e11b81525f6004820152602401610817565b6001600160a01b0382166115c75760405163ec442f0560e01b81525f6004820152602401610817565b6114d0838383611d1e565b6001600160a01b0384165f908152600a60205260409020548111156116395760405162461bcd60e51b815260206004820152601b60248201527f496e73756666696369656e74207374616b65642062616c616e636500000000006044820152606401610817565b6001600160a01b0384165f908152600a6020526040812080548392906116609084906124fa565b90915550611670905083836117e6565b61167a8483611ba9565b6116848382611816565b826001600160a01b0316846001600160a01b03167f8d475b43aec9681aceba0513f65119ec1b972abd328a3b9a3a25720268e47ad5836040516116c991815260200190565b60405180910390a350505050565b6005546001600160a01b03163314610d085760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610817565b611739611e38565b6007805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600754600160a01b900460ff1615610d085760405163d93c066560e01b815260040160405180910390fd5b5f6117bb82610dc2565b6001600160a01b0383165f90815260208190526040902081905590506117df61095c565b6002555050565b6001600160a01b0382165f908152600c60205260408120805483929061180d9084906124e7565b90915550505050565b5f61181f61075f565b90505f61182a61075f565b116118605760405162461bcd60e51b81526020600482015260066024820152652ba0ba3b181b60d11b6044820152606401610817565b6001600160a01b0383165f908152600a6020526040812054900361189d576001600160a01b0383165f908152600b60205260409020819055611925565b6001600160a01b0383165f908152600a60205260409020546118c09083906124e7565b6118ca82846124a9565b6001600160a01b0385165f908152600b6020908152604080832054600a909252909120546118f891906124a9565b61190291906124e7565b61190c91906124d4565b6001600160a01b0384165f908152600b60205260409020555b6001600160a01b0383165f908152600a60205260408120805484929061194c9084906124e7565b90915550506001600160a01b0383165f818152600b6020908152604091829020548251858152918201527f96de51bb44ea8db009e5d619876794e2d6fe71040caf3ffecc29133698db9ce5910160405180910390a2505050565b6119d27f00000000000000000000000072ec8447074dc0bfbedfb516cc250b525f3a4aba853085611e62565b6119dc8382611e9a565b826001600160a01b0316846001600160a01b03167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d784846040516116c9929190918252602082015260400190565b600680546001600160a01b031916905561104781611ed2565b611a4b611786565b6007805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586117693390565b6040516001600160a01b0383166024820152604481018290526114d090849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611f23565b826001600160a01b0316856001600160a01b031614611b0d57611b0d8386836114f9565b611b178382611ff4565b611b427f00000000000000000000000072ec8447074dc0bfbedfb516cc250b525f3a4aba8584611a86565b826001600160a01b0316846001600160a01b0316866001600160a01b03167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8585604051611b9a929190918252602082015260400190565b60405180910390a45050505050565b6001600160a01b0382165f908152600d60205260408120805483929061180d9084906124e7565b6007546001600160a01b03163314610d085760405162461bcd60e51b81526020600482015260026024820152614e4160f01b6044820152606401610817565b5f611c3c611c1c83612028565b8015611c3757505f8480611c3257611c326124c0565b868809115b151590565b611c47868686612054565b611c5191906124e7565b95945050505050565b6001600160a01b038416611c835760405163e602df0560e01b81525f6004820152602401610817565b6001600160a01b038316611cac57604051634a1406b160e11b81525f6004820152602401610817565b6001600160a01b038085165f908152600160209081526040808320938716835292905220829055801561156f57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516116c991815260200190565b6001600160a01b038316611d48578060025f828254611d3d91906124e7565b90915550611dac9050565b5f611d5284610dc2565b905081811015611d8e5760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610817565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b038216611dc857600280548290039055611de6565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611e2b91815260200190565b60405180910390a3505050565b600754600160a01b900460ff16610d0857604051638dfc202b60e01b815260040160405180910390fd5b6040516001600160a01b038085166024830152831660448201526064810182905261156f9085906323b872dd60e01b90608401611ab2565b6001600160a01b038216611ec35760405163ec442f0560e01b81525f6004820152602401610817565b611ece5f8383611d1e565b5050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f611f77826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166121049092919063ffffffff16565b8051909150156114d05780806020019051810190611f959190612526565b6114d05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610817565b6001600160a01b03821661201d57604051634b637e8f60e11b81525f6004820152602401610817565b611ece825f83611d1e565b5f600282600381111561203d5761203d612545565b6120479190612559565b60ff166001149050919050565b5f5f5f6120618686612112565b91509150815f036120855783818161207b5761207b6124c0565b0492505050610cc6565b81841161209c5761209c600385150260111861212e565b5f848688095f868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010185841190960395909502919093039390930492909217029150509392505050565b6060610dba84845f8561213f565b5f805f1983850993909202808410938190039390930393915050565b634e487b715f52806020526024601cfd5b6060824710156121a05760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610817565b5f5f866001600160a01b031685876040516121bb919061257a565b5f6040518083038185875af1925050503d805f81146121f5576040519150601f19603f3d011682016040523d82523d5f602084013e6121fa565b606091505b509150915061220b87838387612216565b979650505050505050565b606083156122845782515f0361227d576001600160a01b0385163b61227d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610817565b5081610dba565b610dba83838151156122995781518083602001fd5b8060405162461bcd60e51b815260040161081791905b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b5f602082840312156122f4575f5ffd5b5035919050565b6001600160a01b0381168114611047575f5ffd5b5f5f60408385031215612320575f5ffd5b823561232b816122fb565b946020939093013593505050565b5f60208284031215612349575f5ffd5b8135610cc6816122fb565b5f5f5f60608486031215612366575f5ffd5b8335612371816122fb565b92506020840135612381816122fb565b929592945050506040919091013590565b5f5f604083850312156123a3575f5ffd5b8235915060208301356123b5816122fb565b809150509250929050565b5f5f5f606084860312156123d2575f5ffd5b8335925060208401356123e4816122fb565b915060408401356123f4816122fb565b809150509250925092565b5f5f60408385031215612410575f5ffd5b823561241b816122fb565b915060208301356123b5816122fb565b5f6020828403121561243b575f5ffd5b5051919050565b600181811c9082168061245657607f821691505b60208210810361247457634e487b7160e01b5f52602260045260245ffd5b50919050565b5f6020828403121561248a575f5ffd5b8151610cc6816122fb565b634e487b7160e01b5f52601160045260245ffd5b808202811582820484141761073757610737612495565b634e487b7160e01b5f52601260045260245ffd5b5f826124e2576124e26124c0565b500490565b8082018082111561073757610737612495565b8181038181111561073757610737612495565b60ff818116838216019081111561073757610737612495565b5f60208284031215612536575f5ffd5b81518015158114610cc6575f5ffd5b634e487b7160e01b5f52602160045260245ffd5b5f60ff83168061256b5761256b6124c0565b8060ff84160691505092915050565b5f82518060208501845e5f92019182525091905056fea2646970667358221220f26636ac305ccb2d6979d22fb992af209f4eab9581e70f0930791c5d9202342c64736f6c634300081e0033
Verified Source Code Partial Match
Compiler: v0.8.30+commit.73712a01
EVM: prague
Optimization: Yes (200 runs)
AtvWrappedBoosterTL.sol 4113 lines
// File: contracts/Interfaces/Context.sol
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @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;
}
}
// File: contracts/Interfaces/IERC20.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @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);
}
// File: contracts/Interfaces/IERC20Metadata.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface for the optional metadata functions from the ERC-20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
// File: contracts/Interfaces/draft-IERC6093.sol
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;
/**
* @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);
}
// File: contracts/Interfaces/ERC20.sol
// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC-20
* applications.
*/
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
mapping(address account => uint256) internal _balances;
mapping(address account => mapping(address spender => uint256)) private _allowances;
uint256 internal _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* Both values are immutable: they can only be set once during construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual returns (uint8) {
return 18;
}
/// @inheritdoc IERC20
function totalSupply() public view virtual override(IERC20) returns (uint256) {
return _totalSupply;
}
/// @inheritdoc IERC20
function balanceOf(address account) public view virtual returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `value`.
*/
function transfer(address to, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, value);
return true;
}
/// @inheritdoc IERC20
function allowance(address owner, address spender) public view virtual returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, value);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Skips emitting an {Approval} event indicating an allowance update. This is not
* required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `value`.
* - the caller must have allowance for ``from``'s tokens of at least
* `value`.
*/
function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, value);
_transfer(from, to, value);
return true;
}
/**
* @dev Moves a `value` amount of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _transfer(address from, address to, uint256 value) internal {
if (from == address(0)) {
revert ERC20InvalidSender(address(0));
}
if (to == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(from, to, value);
}
/**
* @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
* (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
* this function.
*
* Emits a {Transfer} event.
*/
function _update(address from, address to, uint256 value) internal virtual {
if (from == address(0)) {
// Overflow check required: The rest of the code assumes that totalSupply never overflows
_totalSupply += value;
} else {
uint256 fromBalance = _balances[from];
if (fromBalance < value) {
revert ERC20InsufficientBalance(from, fromBalance, value);
}
unchecked {
// Overflow not possible: value <= fromBalance <= totalSupply.
_balances[from] = fromBalance - value;
}
}
if (to == address(0)) {
unchecked {
// Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
_totalSupply -= value;
}
} else {
unchecked {
// Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
_balances[to] += value;
}
}
emit Transfer(from, to, value);
}
/**
* @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
* Relies on the `_update` mechanism
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _mint(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(address(0), account, value);
}
/**
* @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
* Relies on the `_update` mechanism.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead
*/
function _burn(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidSender(address(0));
}
_update(account, address(0), value);
}
/**
* @dev Sets `value` as the allowance of `spender` over the `owner`'s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*
* Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
*/
function _approve(address owner, address spender, uint256 value) internal {
_approve(owner, spender, value, true);
}
/**
* @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
*
* By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
* `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
* `Approval` event during `transferFrom` operations.
*
* Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
* true using the following override:
*
* ```solidity
* function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
* super._approve(owner, spender, value, true);
* }
* ```
*
* Requirements are the same as {_approve}.
*/
function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
if (owner == address(0)) {
revert ERC20InvalidApprover(address(0));
}
if (spender == address(0)) {
revert ERC20InvalidSpender(address(0));
}
_allowances[owner][spender] = value;
if (emitEvent) {
emit Approval(owner, spender, value);
}
}
/**
* @dev Updates `owner`'s allowance for `spender` based on spent `value`.
*
* Does not update the allowance value in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Does not emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance < type(uint256).max) {
if (currentAllowance < value) {
revert ERC20InsufficientAllowance(spender, currentAllowance, value);
}
unchecked {
_approve(owner, spender, currentAllowance - value, false);
}
}
}
}
// File: contracts/Interfaces/draft-IERC20Permit.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 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.
*/
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].
*/
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);
}
// File: contracts/Interfaces/Address.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @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://diligence.consensys.net/posts/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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @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, it is bubbled up by this
* function (like regular Solidity function calls).
*
* 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.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @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`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) 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(errorMessage);
}
}
}
// File: contracts/Interfaces/SafeERC20.sol
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File: contracts/Interfaces/IERC4626.sol
// OpenZeppelin Contracts (last updated v5.3.0) (interfaces/IERC4626.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-4626 "Tokenized Vault Standard", as defined in
* https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].
*/
interface IERC4626 is IERC20, IERC20Metadata {
event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);
event Withdraw(
address indexed sender,
address indexed receiver,
address indexed owner,
uint256 assets,
uint256 shares
);
/**
* @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.
*
* - MUST be an ERC-20 token contract.
* - MUST NOT revert.
*/
function asset() external view returns (address assetTokenAddress);
/**
* @dev Returns the total amount of the underlying asset that is “managed” by Vault.
*
* - SHOULD include any compounding that occurs from yield.
* - MUST be inclusive of any fees that are charged against assets in the Vault.
* - MUST NOT revert.
*/
function totalAssets() external view returns (uint256 totalManagedAssets);
/**
* @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal
* scenario where all the conditions are met.
*
* - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
* - MUST NOT show any variations depending on the caller.
* - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
* - MUST NOT revert.
*
* NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
* “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
* from.
*/
function convertToShares(uint256 assets) external view returns (uint256 shares);
/**
* @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal
* scenario where all the conditions are met.
*
* - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
* - MUST NOT show any variations depending on the caller.
* - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
* - MUST NOT revert.
*
* NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
* “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
* from.
*/
function convertToAssets(uint256 shares) external view returns (uint256 assets);
/**
* @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,
* through a deposit call.
*
* - MUST return a limited value if receiver is subject to some deposit limit.
* - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.
* - MUST NOT revert.
*/
function maxDeposit(address receiver) external view returns (uint256 maxAssets);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given
* current on-chain conditions.
*
* - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit
* call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called
* in the same transaction.
* - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the
* deposit would be accepted, regardless if the user has enough tokens approved, etc.
* - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by depositing.
*/
function previewDeposit(uint256 assets) external view returns (uint256 shares);
/**
* @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.
*
* - MUST emit the Deposit event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
* deposit execution, and are accounted for during deposit.
* - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not
* approving enough underlying tokens to the Vault contract, etc).
*
* NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
*/
function deposit(uint256 assets, address receiver) external returns (uint256 shares);
/**
* @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.
* - MUST return a limited value if receiver is subject to some mint limit.
* - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.
* - MUST NOT revert.
*/
function maxMint(address receiver) external view returns (uint256 maxShares);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given
* current on-chain conditions.
*
* - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call
* in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the
* same transaction.
* - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint
* would be accepted, regardless if the user has enough tokens approved, etc.
* - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by minting.
*/
function previewMint(uint256 shares) external view returns (uint256 assets);
/**
* @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.
*
* - MUST emit the Deposit event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint
* execution, and are accounted for during mint.
* - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not
* approving enough underlying tokens to the Vault contract, etc).
*
* NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
*/
function mint(uint256 shares, address receiver) external returns (uint256 assets);
/**
* @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the
* Vault, through a withdraw call.
*
* - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
* - MUST NOT revert.
*/
function maxWithdraw(address owner) external view returns (uint256 maxAssets);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,
* given current on-chain conditions.
*
* - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw
* call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if
* called
* in the same transaction.
* - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though
* the withdrawal would be accepted, regardless if the user has enough shares, etc.
* - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by depositing.
*/
function previewWithdraw(uint256 assets) external view returns (uint256 shares);
/**
* @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.
*
* - MUST emit the Withdraw event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
* withdraw execution, and are accounted for during withdraw.
* - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner
* not having enough shares, etc).
*
* Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
* Those methods should be performed separately.
*/
function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);
/**
* @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,
* through a redeem call.
*
* - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
* - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.
* - MUST NOT revert.
*/
function maxRedeem(address owner) external view returns (uint256 maxShares);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their redemption at the current block,
* given current on-chain conditions.
*
* - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call
* in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the
* same transaction.
* - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the
* redemption would be accepted, regardless if the user has enough shares, etc.
* - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be cons...
// [truncated — 153611 bytes total]
Read Contract
accruedReward 0x189212f0 → uint256, uint256, uint256, uint256, uint256
allowance 0xdd62ed3e → uint256
asset 0x38d52e0f → address
balanceOf 0x70a08231 → uint256
calculateNAV 0x11ebc619 → uint256
convertToAssets 0x07a2d13a → uint256
convertToShares 0xc6e6f592 → uint256
decimals 0x313ce567 → uint8
getDelayModule 0xd7f58703 → address
maxDeposit 0x402d267d → uint256
maxMint 0xc63d75b6 → uint256
maxRedeem 0xd905777e → uint256
maxWithdraw 0xce96cb77 → uint256
mint 0x94bf804d → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
pendingOwner 0xe30c3978 → address
platformFee 0x26232a2e → uint256
platformWallet 0xfa2af9da → address
previewDeposit 0xef8b30f7 → uint256
previewMint 0xb3d7f6b9 → uint256
previewRedeem 0x4cdad506 → uint256
previewWithdraw 0x0a28a477 → uint256
redeem 0xba087652 → uint256
symbol 0x95d89b41 → string
totalAssets 0x01e1d114 → uint256
totalSharesDeposit 0xf8068bbe → uint256
totalSharesWithdraw 0xb89c79ed → uint256
totalStakedByUser 0x489aa033 → uint256
totalSupply 0x18160ddd → uint256
userStakeNAV 0x7bc862b5 → uint256
Write Contract 14 functions
These functions modify contract state and require a wallet transaction to execute.
acceptOwnership 0x79ba5097
No parameters
approve 0x095ea7b3
address spender
uint256 value
returns: bool
deposit 0x6e553f65
uint256 assets
address receiver
returns: uint256
pause 0x8456cb59
No parameters
renounceOwnership 0x715018a6
No parameters
setDelayModule 0xc4aa09d3
address _delayModule
transfer 0xa9059cbb
address to
uint256 shares
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters
updatePlatformFee 0xaa0b5988
uint256 _fee
updatePlatformWallet 0xada4ef30
address _platformWallet
withdraw 0xb460af94
uint256 assets
address receiver
address owner
returns: uint256
withdrawStrayToken 0xf5591714
address token
Recent Transactions
No transactions found for this address