Address Contract Partially Verified
Address
0x1a561bc61b0F1d05dB97a9b38BCF2bDe277BD9B1
Balance
0 ETH
Nonce
1
Code Size
10973 bytes
Creator
0x637e8B8d...6A60 at tx 0xff09f3ab...e2c35f
Indexed Transactions
0
Contract Bytecode
10973 bytes
0x608060405234801561001057600080fd5b50600436106101985760003560e01c806381763bf1116100e3578063b0bd17d21161008c578063e4dfeac011610066578063e4dfeac014610451578063effe0a241461045a578063f23a6e611461046d57600080fd5b8063b0bd17d2146103f5578063b544bf8314610408578063bc197c811461042f57600080fd5b80639fb08933116100bd5780639fb0893314610391578063a608b317146103a4578063aa082a9d146103de57600080fd5b806381763bf11461033f5780638380edb71461035257806385fde44c1461035f57600080fd5b806344ee3a1c11610145578063565a2e2c1161011f578063565a2e2c146102e95780636e2d47f6146102f1578063796b658b1461031857600080fd5b806344ee3a1c1461028b578063469a417a1461029e57806348c89491146102d657600080fd5b80632f1adb33116101765780632f1adb331461023c57806330fde4e3146102515780634333c1051461026457600080fd5b806301ffc9a71461019d578063150b7a02146101c55780632f17e030146101fd575b600080fd5b6101b06101ab36600461270b565b61048d565b60405190151581526020015b60405180910390f35b6101e46101d3366004612550565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020016101bc565b6102247f000000000000000000000000637e8b8d56164dc83c93b62dd17efb1493936a6081565b6040516001600160a01b0390911681526020016101bc565b61024f61024a36600461263b565b6104c4565b005b61024f61025f36600461263b565b6105f7565b6102247f000000000000000000000000878fd91aeb95c8c492559157c762f86d5549d18981565b61024f610299366004612811565b610816565b6102b16102ac366004612811565b610a0e565b604080516001600160a01b0390941684526020840192909252908201526060016101bc565b61024f6102e4366004612733565b610a4b565b610224610f34565b6102247f000000000000000000000000e67193ca18132e1ccb59ee745b388cecce37cc4c81565b6102247f000000000000000000000000633c270de4eef7f8baedd6f5bbfb89e4b234f9bc81565b61024f61034d366004612666565b611005565b6003546101b09060ff1681565b61037261036d366004612811565b611229565b604080516001600160a01b0390931683526020830191909152016101bc565b61024f61039f366004612811565b611261565b6103b76103b2366004612811565b611397565b604080516001600160a01b03909416845260208401929092521515908201526060016101bc565b6103e760025481565b6040519081526020016101bc565b61024f61040336600461263b565b6113d7565b6103e77f0000000000000000000000000000000000000000000000000000000065455eb381565b6101e461043d366004612495565b63bc197c8160e01b98975050505050505050565b6103e760015481565b61024f6104683660046126b1565b61154e565b6101e461047b3660046125c1565b63f23a6e6160e01b9695505050505050565b60006001600160e01b03198216630a85bd0160e11b14806104be57506001600160e01b03198216630271189760e51b145b92915050565b336104cd610f34565b6001600160a01b0316146105285760405162461bcd60e51b815260206004820181905260248201527f5661756c743a6f6e6c794b6579486f6c6465723a554e415554484f52495a454460448201526064015b60405180910390fd5b6040805160808101825282815233602082019081526fffffffffffffffffffffffffffffffff82840181815260608401828152945163fc6f786560e01b81529351600485015291516001600160a01b039081166024850152915181166044840152925190921660648201529083169063fc6f7865906084016040805180830381600087803b1580156105b957600080fd5b505af11580156105cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f19190612841565b50505050565b33610600610f34565b6001600160a01b0316146106565760405162461bcd60e51b815260206004820181905260248201527f5661756c743a6f6e6c794b6579486f6c6465723a554e415554484f52495a4544604482015260640161051f565b6002544210156106a85760405162461bcd60e51b815260206004820152601e60248201527f5661756c743a6f6e6c79556e6c6f636b61626c653a5052454d41545552450000604482015260640161051f565b6106b182611b5d565b6107235760405162461bcd60e51b815260206004820152603660248201527f4d756c74695661756c743a7061727469616c4e6f6e46756e6769626c65546f6b60448201527f656e556e6c6f636b3a494e56414c49445f544f4b454e00000000000000000000606482015260840161051f565b604051632142170760e11b8152306004820152336024820152604481018290526001600160a01b038316906342842e0e90606401600060405180830381600087803b15801561077157600080fd5b505af1158015610785573d6000803e3d6000fd5b505050507f000000000000000000000000e67193ca18132e1ccb59ee745b388cecce37cc4c6001600160a01b031663e46d96a26107c0611bd4565b6040518263ffffffff1660e01b81526004016107e0911515815260200190565b600060405180830381600087803b1580156107fa57600080fd5b505af115801561080e573d6000803e3d6000fd5b505050505050565b3361081f610f34565b6001600160a01b0316146108755760405162461bcd60e51b815260206004820181905260248201527f5661756c743a6f6e6c794b6579486f6c6465723a554e415554484f52495a4544604482015260640161051f565b600260005414156108c85760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161051f565b600260005560035460ff16156109205760405162461bcd60e51b815260206004820152601f60248201527f5661756c743a657874656e644c6f636b3a46554c4c595f554e4c4f434b454400604482015260640161051f565b600254811161097c5760405162461bcd60e51b815260206004820152602260248201527f5661756c743a657874656e644c6f636b3a494e56414c49445f54494d4553544160448201526104d560f41b606482015260840161051f565b6002805490829055604051631d40341d60e31b815260048101829052602481018390527f000000000000000000000000e67193ca18132e1ccb59ee745b388cecce37cc4c6001600160a01b03169063ea01a0e890604401600060405180830381600087803b1580156109ed57600080fd5b505af1158015610a01573d6000803e3d6000fd5b5050600160005550505050565b60068181548110610a1e57600080fd5b60009182526020909120600390910201805460018201546002909201546001600160a01b03909116925083565b33610a54610f34565b6001600160a01b031614610aaa5760405162461bcd60e51b815260206004820181905260248201527f5661756c743a6f6e6c794b6579486f6c6465723a554e415554484f52495a4544604482015260640161051f565b600254421015610afc5760405162461bcd60e51b815260206004820152601e60248201527f5661756c743a6f6e6c79556e6c6f636b61626c653a5052454d41545552450000604482015260640161051f565b60035460ff1615610b755760405162461bcd60e51b815260206004820152603f60248201527f4d756c74695661756c743a756e6c6f636b3a414c52454144595f4f50454e3a2060448201527f5661756c742068617320616c7265616479206265656e20756e6c6f636b656400606482015260840161051f565b60005b600454811015610c6257600060048281548110610ba557634e487b7160e01b600052603260045260246000fd5b60009182526020822060039190910201546040516370a0823160e01b81523060048201526001600160a01b03909116925082906370a082319060240160206040518083038186803b158015610bf957600080fd5b505afa158015610c0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c319190612829565b90508015610c4d57610c4d6001600160a01b0383163383611e97565b50508080610c5a90612a71565b915050610b78565b5060005b600554811015610d755760058181548110610c9157634e487b7160e01b600052603260045260246000fd5b906000526020600020906002020160000160009054906101000a90046001600160a01b03166001600160a01b03166342842e0e303360058581548110610ce757634e487b7160e01b600052603260045260246000fd5b60009182526020909120600160029092020101546040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b158015610d4a57600080fd5b505af1158015610d5e573d6000803e3d6000fd5b505050508080610d6d90612a71565b915050610c66565b5060005b600654811015610ea55760068181548110610da457634e487b7160e01b600052603260045260246000fd5b906000526020600020906003020160000160009054906101000a90046001600160a01b03166001600160a01b031663f242432a303360068581548110610dfa57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600302016001015460068681548110610e2d57634e487b7160e01b600052603260045260246000fd5b906000526020600020906003020160020154876040518663ffffffff1660e01b8152600401610e609594939291906129e3565b600060405180830381600087803b158015610e7a57600080fd5b505af1158015610e8e573d6000803e3d6000fd5b505050508080610e9d90612a71565b915050610d79565b506003805460ff19166001908117909155604051637236cb5160e11b815260048101919091526001600160a01b037f000000000000000000000000e67193ca18132e1ccb59ee745b388cecce37cc4c169063e46d96a290602401600060405180830381600087803b158015610f1957600080fd5b505af1158015610f2d573d6000803e3d6000fd5b5050505050565b60015460009015610fe0576001546040516331a9108f60e11b815260048101919091527f000000000000000000000000633c270de4eef7f8baedd6f5bbfb89e4b234f9bc6001600160a01b031690636352211e9060240160206040518083038186803b158015610fa357600080fd5b505afa158015610fb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fdb9190612479565b905090565b507f000000000000000000000000878fd91aeb95c8c492559157c762f86d5549d18990565b3361100e610f34565b6001600160a01b0316146110645760405162461bcd60e51b815260206004820181905260248201527f5661756c743a6f6e6c794b6579486f6c6465723a554e415554484f52495a4544604482015260640161051f565b6002544210156110b65760405162461bcd60e51b815260206004820152601e60248201527f5661756c743a6f6e6c79556e6c6f636b61626c653a5052454d41545552450000604482015260640161051f565b6110bf85611f14565b6111315760405162461bcd60e51b815260206004820152603060248201527f4d756c74695661756c743a7061727469616c4d756c7469546f6b656e556e6c6f60448201527f636b3a494e56414c49445f544f4b454e00000000000000000000000000000000606482015260840161051f565b604051637921219560e11b81526001600160a01b0386169063f242432a906111679030903390899089908990899060040161298b565b600060405180830381600087803b15801561118157600080fd5b505af1158015611195573d6000803e3d6000fd5b505050507f000000000000000000000000e67193ca18132e1ccb59ee745b388cecce37cc4c6001600160a01b031663e46d96a26111d0611bd4565b6040518263ffffffff1660e01b81526004016111f0911515815260200190565b600060405180830381600087803b15801561120a57600080fd5b505af115801561121e573d6000803e3d6000fd5b505050505050505050565b6005818154811061123957600080fd5b6000918252602090912060029091020180546001909101546001600160a01b03909116915082565b7f000000000000000000000000637e8b8d56164dc83c93b62dd17efb1493936a606001600160a01b031633146112e55760405162461bcd60e51b815260206004820152602360248201527f5661756c743a6f6e6c7946726f6d4465706c6f7965723a554e415554484f524960448201526216915160ea1b606482015260840161051f565b600260005414156113385760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161051f565b60026000556001541561138d5760405162461bcd60e51b815260206004820181905260248201527f5661756c743a6d696e744b65793a4b45595f414c52454144595f4d494e544544604482015260640161051f565b6001908155600055565b600481815481106113a757600080fd5b60009182526020909120600390910201805460018201546002909201546001600160a01b03909116925060ff1683565b336113e0610f34565b6001600160a01b0316146114365760405162461bcd60e51b815260206004820181905260248201527f5661756c743a6f6e6c794b6579486f6c6465723a554e415554484f52495a4544604482015260640161051f565b6002544210156114885760405162461bcd60e51b815260206004820152601e60248201527f5661756c743a6f6e6c79556e6c6f636b61626c653a5052454d41545552450000604482015260640161051f565b61149182611f82565b6115035760405162461bcd60e51b815260206004820152603360248201527f4d756c74695661756c743a7061727469616c46756e6769626c65546f6b656e5560448201527f6e6c6f636b3a494e56414c49445f544f4b454e00000000000000000000000000606482015260840161051f565b6115176001600160a01b0383163383611e97565b7f000000000000000000000000e67193ca18132e1ccb59ee745b388cecce37cc4c6001600160a01b031663e46d96a26107c0611bd4565b33611557610f34565b6001600160a01b0316146115ad5760405162461bcd60e51b815260206004820181905260248201527f5661756c743a6f6e6c794b6579486f6c6465723a554e415554484f52495a4544604482015260640161051f565b60405163133f757160e31b81526004810184905260009081906001600160a01b038716906399fbab88906024016101806040518083038186803b1580156115f357600080fd5b505afa158015611607573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162b9190612864565b50506040516370a0823160e01b8152306004820152979b5095995060009850506001600160a01b038a1696506370a0823195602401945061166c9350505050565b60206040518083038186803b15801561168457600080fd5b505afa158015611698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116bc9190612829565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038416906370a082319060240160206040518083038186803b15801561170157600080fd5b505afa158015611715573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117399190612829565b6040805160808101825289815230602082019081526fffffffffffffffffffffffffffffffff82840181815260608401828152945163fc6f786560e01b81529351600485015291516001600160a01b0390811660248501529151811660448401529251909216606482015291925089169063fc6f7865906084016040805180830381600087803b1580156117cc57600080fd5b505af11580156117e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118049190612841565b50506040516370a0823160e01b815230600482015260009083906001600160a01b038716906370a082319060240160206040518083038186803b15801561184a57600080fd5b505afa15801561185e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118829190612829565b61188c9190612a2e565b6040516370a0823160e01b815230600482015290915060009083906001600160a01b038716906370a082319060240160206040518083038186803b1580156118d357600080fd5b505afa1580156118e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061190b9190612829565b6119159190612a2e565b905061192b6001600160a01b0387168b84611ff0565b61193f6001600160a01b0386168b83611ff0565b6040805160c0810182528a815260208101848152818301848152606083018c8152608084018c81524260a08601908152955163219f5d1760e01b8152855160048201529351602485015291516044840152516064830152516084820152915160a4830152906001600160a01b038c169063219f5d179060c401606060405180830381600087803b1580156119d257600080fd5b505af11580156119e6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a0a91906127dd565b50506040516370a0823160e01b8152306004820152600091506001600160a01b038916906370a082319060240160206040518083038186803b158015611a4f57600080fd5b505afa158015611a63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a879190612829565b611a919087612a2e565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038916906370a082319060240160206040518083038186803b158015611ad657600080fd5b505afa158015611aea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b0e9190612829565b611b189087612a2e565b90508115611b3457611b346001600160a01b038a163384611e97565b8015611b4e57611b4e6001600160a01b0389163383611e97565b50505050505050505050505050565b6000805b600554811015611bcb5760058181548110611b8c57634e487b7160e01b600052603260045260246000fd5b60009182526020909120600290910201546001600160a01b0384811691161415611bb95750600192915050565b80611bc381612a71565b915050611b61565b50600092915050565b6000805b600454811015611cae57600060048281548110611c0557634e487b7160e01b600052603260045260246000fd5b60009182526020909120600390910201546040516370a0823160e01b81523060048201526001600160a01b03909116906370a082319060240160206040518083038186803b158015611c5657600080fd5b505afa158015611c6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8e9190612829565b1115611c9c57600091505090565b80611ca681612a71565b915050611bd8565b5060005b600554811015611d8857600060058281548110611cdf57634e487b7160e01b600052603260045260246000fd5b60009182526020909120600290910201546040516370a0823160e01b81523060048201526001600160a01b03909116906370a082319060240160206040518083038186803b158015611d3057600080fd5b505afa158015611d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d689190612829565b1115611d7657600091505090565b80611d8081612a71565b915050611cb2565b5060005b600654811015611e8f57600060068281548110611db957634e487b7160e01b600052603260045260246000fd5b600091825260208083206040805160608101825260039490940290910180546001600160a01b03168085526001820154938501849052600290910154848301529051627eeac760e11b8152306004820152602481019290925291935062fdd58e9060440160206040518083038186803b158015611e3557600080fd5b505afa158015611e49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e6d9190612829565b1115611e7c5760009250505090565b5080611e8781612a71565b915050611d8c565b506001905090565b6040516001600160a01b038316602482015260448101829052611f0f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b03199093169290921790915261211b565b505050565b6000805b600654811015611bcb5760068181548110611f4357634e487b7160e01b600052603260045260246000fd5b60009182526020909120600390910201546001600160a01b0384811691161415611f705750600192915050565b80611f7a81612a71565b915050611f18565b6000805b600454811015611bcb5760048181548110611fb157634e487b7160e01b600052603260045260246000fd5b60009182526020909120600390910201546001600160a01b0384811691161415611fde5750600192915050565b80611fe881612a71565b915050611f86565b8015806120795750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561203f57600080fd5b505afa158015612053573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120779190612829565b155b6120eb5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e636500000000000000000000606482015260840161051f565b6040516001600160a01b038316602482015260448101829052611f0f90849063095ea7b360e01b90606401611ec3565b6000612170826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166122009092919063ffffffff16565b805190915015611f0f578080602001905181019061218e91906126eb565b611f0f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161051f565b606061220f8484600085612219565b90505b9392505050565b6060824710156122915760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161051f565b6001600160a01b0385163b6122e85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161051f565b600080866001600160a01b03168587604051612304919061296f565b60006040518083038185875af1925050503d8060008114612341576040519150601f19603f3d011682016040523d82523d6000602084013e612346565b606091505b5091509150612356828286612361565b979650505050505050565b60608315612370575081612212565b8251156123805782518084602001fd5b8160405162461bcd60e51b815260040161051f9190612a1b565b80516123a581612ab8565b919050565b60008083601f8401126123bb578081fd5b50813567ffffffffffffffff8111156123d2578182fd5b6020830191508360208260051b85010111156123ed57600080fd5b9250929050565b60008083601f840112612405578182fd5b50813567ffffffffffffffff81111561241c578182fd5b6020830191508360208285010111156123ed57600080fd5b8051600281900b81146123a557600080fd5b80516fffffffffffffffffffffffffffffffff811681146123a557600080fd5b805162ffffff811681146123a557600080fd5b60006020828403121561248a578081fd5b815161221281612ab8565b60008060008060008060008060a0898b0312156124b0578384fd5b88356124bb81612ab8565b975060208901356124cb81612ab8565b9650604089013567ffffffffffffffff808211156124e7578586fd5b6124f38c838d016123aa565b909850965060608b013591508082111561250b578586fd5b6125178c838d016123aa565b909650945060808b013591508082111561252f578384fd5b5061253c8b828c016123f4565b999c989b5096995094979396929594505050565b600080600080600060808688031215612567578081fd5b853561257281612ab8565b9450602086013561258281612ab8565b935060408601359250606086013567ffffffffffffffff8111156125a4578182fd5b6125b0888289016123f4565b969995985093965092949392505050565b60008060008060008060a087890312156125d9578182fd5b86356125e481612ab8565b955060208701356125f481612ab8565b94506040870135935060608701359250608087013567ffffffffffffffff81111561261d578283fd5b61262989828a016123f4565b979a9699509497509295939492505050565b6000806040838503121561264d578182fd5b823561265881612ab8565b946020939093013593505050565b60008060008060006080868803121561267d578081fd5b853561268881612ab8565b94506020860135935060408601359250606086013567ffffffffffffffff8111156125a4578182fd5b600080600080608085870312156126c6578384fd5b84356126d181612ab8565b966020860135965060408601359560600135945092505050565b6000602082840312156126fc578081fd5b81518015158114612212578182fd5b60006020828403121561271c578081fd5b81356001600160e01b031981168114612212578182fd5b600060208284031215612744578081fd5b813567ffffffffffffffff8082111561275b578283fd5b818401915084601f83011261276e578283fd5b81358181111561278057612780612aa2565b604051601f8201601f19908116603f011681019083821181831017156127a8576127a8612aa2565b816040528281528760208487010111156127c0578586fd5b826020860160208301379182016020019490945295945050505050565b6000806000606084860312156127f1578081fd5b6127fa84612446565b925060208401519150604084015190509250925092565b600060208284031215612822578081fd5b5035919050565b60006020828403121561283a578081fd5b5051919050565b60008060408385031215612853578182fd5b505080516020909101519092909150565b6000806000806000806000806000806000806101808d8f031215612886578586fd5b8c516bffffffffffffffffffffffff811681146128a1578687fd5b9b506128af60208e0161239a565b9a506128bd60408e0161239a565b99506128cb60608e0161239a565b98506128d960808e01612466565b97506128e760a08e01612434565b96506128f560c08e01612434565b955061290360e08e01612446565b94506101008d015193506101208d015192506129226101408e01612446565b91506129316101608e01612446565b90509295989b509295989b509295989b565b6000815180845261295b816020860160208601612a45565b601f01601f19169290920160200192915050565b60008251612981818460208701612a45565b9190910192915050565b60006001600160a01b03808916835280881660208401525085604083015284606083015260a060808301528260a0830152828460c084013781830160c090810191909152601f909201601f1916010195945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261235660a0830184612943565b6020815260006122126020830184612943565b600082821015612a4057612a40612a8c565b500390565b60005b83811015612a60578181015183820152602001612a48565b838111156105f15750506000910152565b6000600019821415612a8557612a85612a8c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114612acd57600080fd5b5056fea164736f6c6343000804000a
Verified Source Code Partial Match
Compiler: v0.8.4+commit.c7e474f2
EVM: istanbul
Optimization: Yes (800 runs)
Vault.sol 105 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import { IERC1155Receiver } from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol";
import { IERC721Receiver } from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import { IDepositHandler } from "../interfaces/IDepositHandler.sol";
import { IVault } from "../interfaces/IVault.sol";
import { IVaultFactory } from "../interfaces/IVaultFactory.sol";
import { IVaultKey } from "../../common/interfaces/IVaultKey.sol";
contract Vault is ReentrancyGuard, IDepositHandler, IVault, IERC721Receiver, IERC1155Receiver {
IVaultFactory public immutable vaultFactoryContract;
IVaultKey public immutable vaultKeyContract;
uint256 public override vaultKeyId;
address public immutable initialBeneficiary;
address public immutable vaultDeployer;
uint256 public immutable lockTimestamp;
uint256 public unlockTimestamp;
bool public isUnlocked;
modifier onlyKeyHolder() {
require(getBeneficiary() == msg.sender, "Vault:onlyKeyHolder:UNAUTHORIZED");
_;
}
modifier onlyFromDeployer() {
require(vaultDeployer == msg.sender, "Vault:onlyFromDeployer:UNAUTHORIZED");
_;
}
modifier onlyUnlockable() {
require(block.timestamp >= unlockTimestamp, "Vault:onlyUnlockable:PREMATURE");
_;
}
constructor(
address _vaultFactory,
address _vaultKeyContractAddress,
address _beneficiary,
uint256 _unlockTimestamp
) {
vaultFactoryContract = IVaultFactory(_vaultFactory);
vaultKeyContract = IVaultKey(_vaultKeyContractAddress);
initialBeneficiary = _beneficiary;
lockTimestamp = block.timestamp;
unlockTimestamp = _unlockTimestamp;
isUnlocked = false;
vaultDeployer = msg.sender;
}
function extendLock(uint256 newUnlockTimestamp) external onlyKeyHolder nonReentrant {
require(!isUnlocked, "Vault:extendLock:FULLY_UNLOCKED");
require(newUnlockTimestamp > unlockTimestamp, "Vault:extendLock:INVALID_TIMESTAMP");
uint256 oldUnlockTimestamp = unlockTimestamp;
unlockTimestamp = newUnlockTimestamp;
vaultFactoryContract.lockExtended(oldUnlockTimestamp, newUnlockTimestamp);
}
function getBeneficiary() public view override returns (address) {
if (vaultKeyId > 0) return vaultKeyContract.ownerOf(vaultKeyId);
return initialBeneficiary;
}
function mintKey(uint256 keyId) external override onlyFromDeployer nonReentrant {
require(vaultKeyId == 0, "Vault:mintKey:KEY_ALREADY_MINTED");
vaultKeyId = keyId;
}
function onERC721Received(
address,
address,
uint256,
bytes calldata
) external pure override returns (bytes4) {
return this.onERC721Received.selector;
}
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes calldata
) external pure override returns (bytes4) {
return this.onERC1155Received.selector;
}
function onERC1155BatchReceived(
address,
address,
uint256[] calldata,
uint256[] calldata,
bytes calldata
) external pure override returns (bytes4) {
return this.onERC1155BatchReceived.selector;
}
function supportsInterface(bytes4 interfaceId) external pure override returns (bool) {
return interfaceId == type(IERC721Receiver).interfaceId || interfaceId == type(IERC1155Receiver).interfaceId;
}
}
MultiVault.sol 220 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { IERC721 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import { IERC1155 } from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import { INonfungiblePositionManager } from "../../common/interfaces/INonfungiblePositionManager.sol";
import { Vault } from "./Vault.sol";
contract MultiVault is Vault {
using SafeERC20 for IERC20;
FungibleTokenDeposit[] public fungibleTokenDeposits;
NonFungibleTokenDeposit[] public nonFungibleTokenDeposits;
MultiTokenDeposit[] public multiTokenDeposits;
constructor(
address _vaultFactory,
address _vaultKeyContractAddress,
address _beneficiary,
uint256 _unlockTimestamp,
bytes memory _fungibleTokenDepositsData,
bytes memory _nonFungibleTokenDepositsData,
bytes memory _multiTokenDepositsData
) Vault(_vaultFactory, _vaultKeyContractAddress, _beneficiary, _unlockTimestamp) {
FungibleTokenDeposit[] memory _fungibleTokenDeposits = abi.decode(_fungibleTokenDepositsData, (FungibleTokenDeposit[]));
NonFungibleTokenDeposit[] memory _nonFungibleTokenDeposits = abi.decode(_nonFungibleTokenDepositsData, (NonFungibleTokenDeposit[]));
MultiTokenDeposit[] memory _multiTokenDeposits = abi.decode(_multiTokenDepositsData, (MultiTokenDeposit[]));
for (uint256 i = 0; i < _fungibleTokenDeposits.length; i++) {
fungibleTokenDeposits.push(_fungibleTokenDeposits[i]);
}
for (uint256 i = 0; i < _nonFungibleTokenDeposits.length; i++) {
nonFungibleTokenDeposits.push(_nonFungibleTokenDeposits[i]);
}
for (uint256 i = 0; i < _multiTokenDeposits.length; i++) {
multiTokenDeposits.push(_multiTokenDeposits[i]);
}
}
/// @notice Collects the fees associated with provided liquidity
/// The contract must hold the erc721 token before it can collect fees
function collectV3PositionFees(address tokenAddress, uint256 tokenId) external onlyKeyHolder {
// set amount0Max and amount1Max to uint256.max to collect all fees
INonfungiblePositionManager(tokenAddress).collect(
INonfungiblePositionManager.CollectParams({
tokenId: tokenId,
recipient: address(msg.sender),
amount0Max: type(uint128).max,
amount1Max: type(uint128).max
})
);
}
/// @notice Collects the fees associated with provided liquidity
/// The contract must hold the erc721 token before it can collect fees
function reinvestV3PositionFees(
address tokenAddress,
uint256 tokenId,
uint256 amount0Min,
uint256 amount1Min
) external onlyKeyHolder {
(, , address token0, address token1, , , , , , , , ) = INonfungiblePositionManager(tokenAddress).positions(tokenId);
uint256 initialBalance0 = IERC20(token0).balanceOf(address(this));
uint256 initialBalance1 = IERC20(token1).balanceOf(address(this));
// set amount0Max and amount1Max to uint256.max to collect all fees
INonfungiblePositionManager(tokenAddress).collect(
INonfungiblePositionManager.CollectParams({
tokenId: tokenId,
recipient: address(this),
amount0Max: type(uint128).max,
amount1Max: type(uint128).max
})
);
uint256 earnedToken0 = IERC20(token0).balanceOf(address(this)) - initialBalance0;
uint256 earnedToken1 = IERC20(token1).balanceOf(address(this)) - initialBalance1;
IERC20(token0).safeApprove(address(tokenAddress), earnedToken0);
IERC20(token1).safeApprove(address(tokenAddress), earnedToken1);
INonfungiblePositionManager.IncreaseLiquidityParams memory params = INonfungiblePositionManager.IncreaseLiquidityParams({
tokenId: tokenId,
amount0Desired: earnedToken0,
amount1Desired: earnedToken1,
amount0Min: amount0Min,
amount1Min: amount1Min,
deadline: block.timestamp
});
INonfungiblePositionManager(tokenAddress).increaseLiquidity(params);
// This can never underflow, as the initial balance is always equals or greater than the current balance
uint256 leftoverToken0 = initialBalance0 - IERC20(token0).balanceOf(address(this));
uint256 leftoverToken1 = initialBalance1 - IERC20(token1).balanceOf(address(this));
// Send leftover tokens back to the vault owner
if (leftoverToken0 > 0) {
IERC20(token0).safeTransfer(msg.sender, leftoverToken0);
}
if (leftoverToken1 > 0) {
IERC20(token1).safeTransfer(msg.sender, leftoverToken1);
}
}
function unlock(bytes memory data) external onlyKeyHolder onlyUnlockable {
require(!isUnlocked, "MultiVault:unlock:ALREADY_OPEN: Vault has already been unlocked");
for (uint256 i = 0; i < fungibleTokenDeposits.length; i++) {
IERC20 token = IERC20(fungibleTokenDeposits[i].tokenAddress);
uint256 balance = token.balanceOf(address(this));
// in case a token is duplicated, only one transfer is required, hence the check
if (balance > 0) {
token.safeTransfer(msg.sender, balance);
}
}
for (uint256 i = 0; i < nonFungibleTokenDeposits.length; i++) {
IERC721(nonFungibleTokenDeposits[i].tokenAddress).safeTransferFrom(address(this), msg.sender, nonFungibleTokenDeposits[i].tokenId);
}
for (uint256 i = 0; i < multiTokenDeposits.length; i++) {
IERC1155(multiTokenDeposits[i].tokenAddress).safeTransferFrom(
address(this),
msg.sender,
multiTokenDeposits[i].tokenId,
multiTokenDeposits[i].amount,
data
);
}
isUnlocked = true;
vaultFactoryContract.notifyUnlock(true);
}
function partialFungibleTokenUnlock(address _tokenAddress, uint256 _tokenAmount) external onlyKeyHolder onlyUnlockable {
require(_isLockedFungibleAddress(_tokenAddress), "MultiVault:partialFungibleTokenUnlock:INVALID_TOKEN");
IERC20(_tokenAddress).safeTransfer(msg.sender, _tokenAmount);
vaultFactoryContract.notifyUnlock(_isCompletelyUnlocked());
}
function partialNonFungibleTokenUnlock(address _tokenAddress, uint256 _tokenId) external onlyKeyHolder onlyUnlockable {
require(_isLockedNonFungibleAddress(_tokenAddress), "MultiVault:partialNonFungibleTokenUnlock:INVALID_TOKEN");
IERC721(_tokenAddress).safeTransferFrom(address(this), msg.sender, _tokenId);
vaultFactoryContract.notifyUnlock(_isCompletelyUnlocked());
}
function partialMultiTokenUnlock(
address _tokenAddress,
uint256 _tokenId,
uint256 _tokenAmount,
bytes calldata data
) external onlyKeyHolder onlyUnlockable {
require(_isLockedMultiAddress(_tokenAddress), "MultiVault:partialMultiTokenUnlock:INVALID_TOKEN");
IERC1155(_tokenAddress).safeTransferFrom(address(this), msg.sender, _tokenId, _tokenAmount, data);
vaultFactoryContract.notifyUnlock(_isCompletelyUnlocked());
}
function _isLockedFungibleAddress(address _tokenAddress) private view returns (bool) {
for (uint256 i = 0; i < fungibleTokenDeposits.length; i++) {
if (_tokenAddress == fungibleTokenDeposits[i].tokenAddress) {
return true;
}
}
return false;
}
function _isLockedNonFungibleAddress(address _tokenAddress) private view returns (bool) {
for (uint256 i = 0; i < nonFungibleTokenDeposits.length; i++) {
if (_tokenAddress == nonFungibleTokenDeposits[i].tokenAddress) {
return true;
}
}
return false;
}
function _isLockedMultiAddress(address _tokenAddress) private view returns (bool) {
for (uint256 i = 0; i < multiTokenDeposits.length; i++) {
if (_tokenAddress == multiTokenDeposits[i].tokenAddress) {
return true;
}
}
return false;
}
function _isCompletelyUnlocked() private view returns (bool) {
for (uint256 i = 0; i < fungibleTokenDeposits.length; i++) {
if (IERC20(fungibleTokenDeposits[i].tokenAddress).balanceOf(address(this)) > 0) {
return false;
}
}
for (uint256 i = 0; i < nonFungibleTokenDeposits.length; i++) {
if (IERC721(nonFungibleTokenDeposits[i].tokenAddress).balanceOf(address(this)) > 0) {
return false;
}
}
for (uint256 i = 0; i < multiTokenDeposits.length; i++) {
MultiTokenDeposit memory deposit = multiTokenDeposits[i];
if (IERC1155(deposit.tokenAddress).balanceOf(address(this), deposit.tokenId) > 0) {
return false;
}
}
return true;
}
}
IVault.sol 10 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
interface IVault {
function getBeneficiary() external view returns (address);
function mintKey(uint256 keyId) external;
function vaultKeyId() external view returns (uint256);
}
Address.sol 222 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @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 functionCall(target, data, "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");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(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) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(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) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason 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 {
// 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);
}
}
}
}
IVaultKey.sol 13 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import { IERC721Enumerable } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
interface IVaultKey is IERC721Enumerable {
function mintKey(address to, address vault) external;
function lastMintedKeyId(address to) external view returns (uint256);
event VaultKeyMinted(uint256 previousBlock, address indexed to, uint256 indexed tokenId, address indexed vault);
event VaultKeyTransfer(uint256 previousBlock, address from, address indexed to, uint256 indexed tokenId);
}
IVaultFactory.sol 39 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import { IDepositHandler } from "./IDepositHandler.sol";
interface IVaultFactory is IDepositHandler {
function createVault(
address referrer,
address beneficiary,
uint256 unlockTimestamp,
IDepositHandler.FungibleTokenDeposit[] memory fungibleTokenDeposits,
IDepositHandler.NonFungibleTokenDeposit[] memory nonFungibleTokenDeposits,
IDepositHandler.MultiTokenDeposit[] memory multiTokenDeposits,
bool isVesting
) external payable;
function createVaultWithoutKey(
address referrer,
address beneficiary,
uint256 unlockTimestamp,
IDepositHandler.FungibleTokenDeposit[] memory fungibleTokenDeposits,
IDepositHandler.NonFungibleTokenDeposit[] memory nonFungibleTokenDeposits,
IDepositHandler.MultiTokenDeposit[] memory multiTokenDeposits,
bool isVesting
) external payable;
function burn(
address referrer,
IDepositHandler.FungibleTokenDeposit[] memory fungibleTokenDeposits,
IDepositHandler.NonFungibleTokenDeposit[] memory nonFungibleTokenDeposits,
IDepositHandler.MultiTokenDeposit[] memory multiTokenDeposits
) external payable;
function notifyUnlock(bool isCompletelyUnlocked) external;
function lockExtended(uint256 oldUnlockTimestamp, uint256 newUnlockTimestamp) external;
function paymentModule() external view returns (address);
}
IERC20.sol 82 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
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 amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` 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 amount
) external returns (bool);
}
IDepositHandler.sol 29 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
interface IDepositHandler {
struct FungibleTokenDeposit {
address tokenAddress;
uint256 amount;
bool isLP;
}
struct NonFungibleTokenDeposit {
address tokenAddress;
uint256 tokenId;
}
struct MultiTokenDeposit {
address tokenAddress;
uint256 tokenId;
uint256 amount;
}
struct V3LPData {
address tokenAddress;
address token0;
address token1;
uint128 liquidityToRemove;
uint24 fee;
}
}
IERC721.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
IERC1155.sol 125 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}
ReentrancyGuard.sol 63 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
SafeERC20.sol 116 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @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");
}
}
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @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[EIP 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);
}
IERC721Receiver.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
IERC1155Receiver.sol 58 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev _Available since v3.1._
*/
interface IERC1155Receiver is IERC165 {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: To accept the transfer, this must return
* `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
* (i.e. 0xf23a6e61, or its own function selector).
*
* @param operator The address which initiated the transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param id The ID of the token being transferred
* @param value The amount of tokens being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Handles the receipt of a multiple ERC1155 token types. This function
* is called at the end of a `safeBatchTransferFrom` after the balances have
* been updated.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}
INonfungiblePositionManager.sol 144 lines
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity 0.8.4;
pragma abicoder v2;
import { IERC721Enumerable } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
/// @title Non-fungible token for positions
/// @notice Wraps Uniswap V3 positions in a non-fungible token interface which allows for them to be transferred
/// and authorized.
interface INonfungiblePositionManager is IERC721Enumerable {
/// @notice Returns the position information associated with a given token ID.
/// @dev Throws if the token ID is not valid.
/// @param tokenId The ID of the token that represents the position
/// @return nonce The nonce for permits
/// @return operator The address that is approved for spending
/// @return token0 The address of the token0 for a specific pool
/// @return token1 The address of the token1 for a specific pool
/// @return fee The fee associated with the pool
/// @return tickLower The lower end of the tick range for the position
/// @return tickUpper The higher end of the tick range for the position
/// @return liquidity The liquidity of the position
/// @return feeGrowthInside0LastX128 The fee growth of token0 as of the last action on the individual position
/// @return feeGrowthInside1LastX128 The fee growth of token1 as of the last action on the individual position
/// @return tokensOwed0 The uncollected amount of token0 owed to the position as of the last computation
/// @return tokensOwed1 The uncollected amount of token1 owed to the position as of the last computation
function positions(uint256 tokenId)
external
view
returns (
uint96 nonce,
address operator,
address token0,
address token1,
uint24 fee,
int24 tickLower,
int24 tickUpper,
uint128 liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);
struct MintParams {
address token0;
address token1;
uint24 fee;
int24 tickLower;
int24 tickUpper;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
address recipient;
uint256 deadline;
}
/// @notice Creates a new position wrapped in a NFT
/// @dev Call this when the pool does exist and is initialized. Note that if the pool is created but not initialized
/// a method does not exist, i.e. the pool is assumed to be initialized.
/// @param params The params necessary to mint a position, encoded as `MintParams` in calldata
/// @return tokenId The ID of the token that represents the minted position
/// @return liquidity The amount of liquidity for this position
/// @return amount0 The amount of token0
/// @return amount1 The amount of token1
function mint(MintParams calldata params)
external
payable
returns (
uint256 tokenId,
uint128 liquidity,
uint256 amount0,
uint256 amount1
);
struct IncreaseLiquidityParams {
uint256 tokenId;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}
/// @notice Increases the amount of liquidity in a position, with tokens paid by the `msg.sender`
/// @param params tokenId The ID of the token for which liquidity is being increased,
/// amount0Desired The desired amount of token0 to be spent,
/// amount1Desired The desired amount of token1 to be spent,
/// amount0Min The minimum amount of token0 to spend, which serves as a slippage check,
/// amount1Min The minimum amount of token1 to spend, which serves as a slippage check,
/// deadline The time by which the transaction must be included to effect the change
/// @return liquidity The new liquidity amount as a result of the increase
/// @return amount0 The amount of token0 to acheive resulting liquidity
/// @return amount1 The amount of token1 to acheive resulting liquidity
function increaseLiquidity(IncreaseLiquidityParams calldata params)
external
payable
returns (
uint128 liquidity,
uint256 amount0,
uint256 amount1
);
struct DecreaseLiquidityParams {
uint256 tokenId;
uint128 liquidity;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}
/// @notice Decreases the amount of liquidity in a position and accounts it to the position
/// @param params tokenId The ID of the token for which liquidity is being decreased,
/// amount The amount by which liquidity will be decreased,
/// amount0Min The minimum amount of token0 that should be accounted for the burned liquidity,
/// amount1Min The minimum amount of token1 that should be accounted for the burned liquidity,
/// deadline The time by which the transaction must be included to effect the change
/// @return amount0 The amount of token0 accounted to the position's tokens owed
/// @return amount1 The amount of token1 accounted to the position's tokens owed
function decreaseLiquidity(DecreaseLiquidityParams calldata params) external payable returns (uint256 amount0, uint256 amount1);
struct CollectParams {
uint256 tokenId;
address recipient;
uint128 amount0Max;
uint128 amount1Max;
}
/// @notice Collects up to a maximum amount of fees owed to a specific position to the recipient
/// @param params tokenId The ID of the NFT for which tokens are being collected,
/// recipient The account that should receive the tokens,
/// amount0Max The maximum amount of token0 to collect,
/// amount1Max The maximum amount of token1 to collect
/// @return amount0 The amount of fees collected in token0
/// @return amount1 The amount of fees collected in token1
function collect(CollectParams calldata params) external payable returns (uint256 amount0, uint256 amount1);
/// @notice Burns a token ID, which deletes it from the NFT contract. The token must have 0 liquidity and all tokens
/// must be collected first.
/// @param tokenId The ID of the token that is being burned
function burn(uint256 tokenId) external payable;
function factory() external view returns (address);
}
draft-IERC20Permit.sol 60 lines
// SPDX-License-Identifier: MIT
// 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);
}
IERC721Enumerable.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
Read Contract
fungibleTokenDeposits 0xa608b317 → address, uint256, bool
getBeneficiary 0x565a2e2c → address
initialBeneficiary 0x4333c105 → address
isUnlocked 0x8380edb7 → bool
lockTimestamp 0xb544bf83 → uint256
multiTokenDeposits 0x469a417a → address, uint256, uint256
nonFungibleTokenDeposits 0x85fde44c → address, uint256
onERC1155BatchReceived 0xbc197c81 → bytes4
onERC1155Received 0xf23a6e61 → bytes4
onERC721Received 0x150b7a02 → bytes4
supportsInterface 0x01ffc9a7 → bool
unlockTimestamp 0xaa082a9d → uint256
vaultDeployer 0x2f17e030 → address
vaultFactoryContract 0x6e2d47f6 → address
vaultKeyContract 0x796b658b → address
vaultKeyId 0xe4dfeac0 → uint256
Write Contract 8 functions
These functions modify contract state and require a wallet transaction to execute.
collectV3PositionFees 0x2f1adb33
address tokenAddress
uint256 tokenId
extendLock 0x44ee3a1c
uint256 newUnlockTimestamp
mintKey 0x9fb08933
uint256 keyId
partialFungibleTokenUnlock 0xb0bd17d2
address _tokenAddress
uint256 _tokenAmount
partialMultiTokenUnlock 0x81763bf1
address _tokenAddress
uint256 _tokenId
uint256 _tokenAmount
bytes data
partialNonFungibleTokenUnlock 0x30fde4e3
address _tokenAddress
uint256 _tokenId
reinvestV3PositionFees 0xeffe0a24
address tokenAddress
uint256 tokenId
uint256 amount0Min
uint256 amount1Min
unlock 0x48c89491
bytes data
Recent Transactions
No transactions found for this address