Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x44eF99a15cC70c8D1751753F94e84b8CB1EE52Fb
Balance 0 ETH
Nonce 1
Code Size 9482 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

9482 bytes
0x608060405234801561001057600080fd5b50600436106101da5760003560e01c806385d79a7911610104578063c19330df116100a2578063de0e9a3e11610071578063de0e9a3e14610561578063ea598cb01461057e578063f2fde38b1461059b578063f8f2be7f146105c1576101da565b8063c19330df146104df578063ce937499146104e7578063db0a8d501461050d578063dd62ed3e14610533576101da565b806395d89b41116100de57806395d89b4114610462578063a457c2d71461046a578063a694fc3a14610496578063a9059cbb146104b3576101da565b806385d79a79146104175780638da5cb5b1461043d5780638fad262714610445576101da565b8063395093511161017c5780636e3889591161014b5780636e388959146103ad57806370a08231146103ca578063715018a6146103f0578063797260a9146103fa576101da565b806339509351146103695780633b6cbfb1146103955780635f7084431461039d5780636540a1a9146103a5576101da565b8063196e3892116101b8578063196e3892146102b657806323b872dd146102f85780632e17de781461032e578063313ce5671461034b576101da565b806306fdde03146101df578063095ea7b31461025c57806318160ddd1461029c575b600080fd5b6101e76105c9565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610221578181015183820152602001610209565b50505050905090810190601f16801561024e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102886004803603604081101561027257600080fd5b506001600160a01b03813516906020013561065f565b604080519115158252519081900360200190f35b6102a461067d565b60408051918252519081900360200190f35b6102dc600480360360208110156102cc57600080fd5b50356001600160a01b0316610683565b604080516001600160a01b039092168252519081900360200190f35b6102886004803603606081101561030e57600080fd5b506001600160a01b0381358116916020810135909116906040013561075e565b6102886004803603602081101561034457600080fd5b50356107e5565b6103536108b2565b6040805160ff9092168252519081900360200190f35b6102886004803603604081101561037f57600080fd5b506001600160a01b0381351690602001356108bb565b6102dc610909565b6102dc610918565b6102dc61092c565b6102a4600480360360208110156103c357600080fd5b503561093b565b6102a4600480360360208110156103e057600080fd5b50356001600160a01b0316610b7d565b6103f8610b98565b005b6102a46004803603602081101561041057600080fd5b5035610c3a565b6102dc6004803603602081101561042d57600080fd5b50356001600160a01b0316610f16565b6102dc61109c565b6103f86004803603602081101561045b57600080fd5b50356110ab565b6101e7611223565b6102886004803603604081101561048057600080fd5b506001600160a01b038135169060200135611284565b610288600480360360208110156104ac57600080fd5b50356112ec565b610288600480360360408110156104c957600080fd5b506001600160a01b038135169060200135611446565b61028861145a565b6102dc600480360360208110156104fd57600080fd5b50356001600160a01b0316611523565b6102dc6004803603602081101561052357600080fd5b50356001600160a01b03166115d8565b6102a46004803603604081101561054957600080fd5b506001600160a01b03813581169160200135166116a4565b6103f86004803603602081101561057757600080fd5b50356116cf565b6102a46004803603602081101561059457600080fd5b503561190a565b6103f8600480360360208110156105b157600080fd5b50356001600160a01b0316611b68565b6102dc611c60565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106555780601f1061062a57610100808354040283529160200191610655565b820191906000526020600020905b81548152906001019060200180831161063857829003601f168201915b5050505050905090565b600061067361066c611c6f565b8484611c73565b5060015b92915050565b60035490565b600061068d611c6f565b6000546001600160a01b039081169116146106dd576040805162461bcd60e51b815260206004820181905260248201526000805160206123e6833981519152604482015290519081900360640190fd5b600a80546001600160a01b0319166001600160a01b03841690811790915560068054610100600160a81b0319166101008302179055604080516020808252600490820152634141564560e01b818301529051600080516020612470833981519152916060908290030190a2505060065461010090046001600160a01b031690565b600061076b848484611d5f565b6107db84610777611c6f565b6107d6856040518060600160405280602881526020016123be602891396001600160a01b038a166000908152600260205260408120906107b5611c6f565b6001600160a01b031681526020810191909152604001600020549190611ebc565b611c73565b5060019392505050565b60006107ef611c6f565b6000546001600160a01b0390811691161461083f576040805162461bcd60e51b815260206004820181905260248201526000805160206123e6833981519152604482015290519081900360640190fd5b600b54604080516301e9a69560e41b81523360048201526024810185905290516001600160a01b0390921691631e9a69509160448082019260009290919082900301818387803b15801561089257600080fd5b505af11580156108a6573d6000803e3d6000fd5b50600195945050505050565b60065460ff1690565b60006106736108c8611c6f565b846107d685600260006108d9611c6f565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611f53565b6008546001600160a01b031681565b60065461010090046001600160a01b031681565b6007546001600160a01b031681565b600654600754604080516370a0823160e01b815230600482015290516000936001600160a01b036101009091048116931691849184916370a08231916024808301926020929190829003018186803b15801561099657600080fd5b505afa1580156109aa573d6000803e3d6000fd5b505050506040513d60208110156109c057600080fd5b5051604080516370a0823160e01b815230600482015290519192506000916001600160a01b038516916370a08231916024808301926020929190829003018186803b158015610a0e57600080fd5b505afa158015610a22573d6000803e3d6000fd5b505050506040513d6020811015610a3857600080fd5b505190508181016000610a4961067d565b90506000610a6183610a5b8b85611fb4565b9061200d565b9050611388600a82020460018111610ab0576040805162461bcd60e51b815260206004820152600d60248201526c4665653a556e70617961626c6560981b604482015290519081900360640190fd5b6040805163a9059cbb60e01b81523360048201528284036024820181905291516001600160a01b038a169163a9059cbb9160448083019260209291908290030181600087803b158015610b0257600080fd5b505af1158015610b16573d6000803e3d6000fd5b505050506040513d6020811015610b2c57600080fd5b50610b399050338c61204f565b604080518c8152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2505050505050505050919050565b6001600160a01b031660009081526001602052604090205490565b610ba0611c6f565b6000546001600160a01b03908116911614610bf0576040805162461bcd60e51b815260206004820181905260248201526000805160206123e6833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600654600754604080516370a0823160e01b815230600482015290516000936001600160a01b036101009091048116931691849184916370a08231916024808301926020929190829003018186803b158015610c9557600080fd5b505afa158015610ca9573d6000803e3d6000fd5b505050506040513d6020811015610cbf57600080fd5b5051604080516370a0823160e01b815230600482015290519192506000916001600160a01b038516916370a08231916024808301926020929190829003018186803b158015610d0d57600080fd5b505afa158015610d21573d6000803e3d6000fd5b505050506040513d6020811015610d3757600080fd5b505190508181016000610d4861067d565b9050801580610d55575081155b15610d6957610d64338961214b565b610e43565b6000610d7983610a5b8b85611fb4565b9050611388600a82020460018111610dc8576040805162461bcd60e51b815260206004820152600d60248201526c4665653a556e70617961626c6560981b604482015290519081900360640190fd5b808203610dd5338261214b565b600954610deb906001600160a01b03168361214b565b60408051828152905133916000805160206124b5833981519152919081900360200190a26009546040805184815290516001600160a01b03909216916000805160206124b58339815191529181900360200190a25050505b604080516323b872dd60e01b8152336004820152306024820152604481018a905290516001600160a01b038716916323b872dd9160648083019260209291908290030181600087803b158015610e9857600080fd5b505af1158015610eac573d6000803e3d6000fd5b505050506040513d6020811015610ec257600080fd5b5051610f0a576040805162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f75676820746f6b656e732160701b604482015290519081900360640190fd5b50959695505050505050565b6000610f20611c6f565b6000546001600160a01b03908116911614610f70576040805162461bcd60e51b815260206004820181905260248201526000805160206123e6833981519152604482015290519081900360640190fd5b600b54604080516317066a5760e21b81526001600160a01b03858116600483015291519190921691635c19a95c91602480830192600092919082900301818387803b158015610fbe57600080fd5b505af1158015610fd2573d6000803e3d6000fd5b5050600a54604080516317066a5760e21b81526001600160a01b0387811660048301529151919092169350635c19a95c9250602480830192600092919082900301818387803b15801561102457600080fd5b505af1158015611038573d6000803e3d6000fd5b5050600880546001600160a01b0386166001600160a01b03199091168117909155604080516020808252600a90820152693232b632b3b0ba34b7b760b11b818301529051919350600080516020612470833981519152925081900360600190a25090565b6000546001600160a01b031690565b6110b3611c6f565b6000546001600160a01b03908116911614611103576040805162461bcd60e51b815260206004820181905260248201526000805160206123e6833981519152604482015290519081900360640190fd5b600b54600954604080516309a99b4f60e41b81526001600160a01b039283166004820152611388600a8602046024820181905291519193848603931691639a99b4f09160448082019260009290919082900301818387803b15801561116757600080fd5b505af115801561117b573d6000803e3d6000fd5b5050600b54604080516309a99b4f60e41b81523060048201526024810186905290516001600160a01b039092169350639a99b4f0925060448082019260009290919082900301818387803b1580156111d257600080fd5b505af11580156111e6573d6000803e3d6000fd5b50506040805186815290517ff8738c258eacbb175b764334c95a51c4e5efc89acca8058bb23d95de4f1c09ee9350908190036020019150a1505050565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106555780601f1061062a57610100808354040283529160200191610655565b6000610673611291611c6f565b846107d68560405180606001604052806025815260200161249060259139600260006112bb611c6f565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611ebc565b60006112f6611c6f565b6000546001600160a01b03908116911614611346576040805162461bcd60e51b815260206004820181905260248201526000805160206123e6833981519152604482015290519081900360640190fd5b6006546007546040805163095ea7b360e01b81526001600160a01b03928316600482015260248101869052905161010090930490911691829163095ea7b39160448083019260209291908290030181600087803b1580156113a657600080fd5b505af11580156113ba573d6000803e3d6000fd5b505050506040513d60208110156113d057600080fd5b5050600b54604080516356e4bb9760e11b81523360048201526024810186905290516001600160a01b039092169163adc9772e9160448082019260009290919082900301818387803b15801561142557600080fd5b505af1158015611439573d6000803e3d6000fd5b5060019695505050505050565b6000610673611453611c6f565b8484611d5f565b6000611464611c6f565b6000546001600160a01b039081169116146114b4576040805162461bcd60e51b815260206004820181905260248201526000805160206123e6833981519152604482015290519081900360640190fd5b600b60009054906101000a90046001600160a01b03166001600160a01b031663787a08a66040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561150457600080fd5b505af1158015611518573d6000803e3d6000fd5b505050506001905090565b600061152d611c6f565b6000546001600160a01b0390811691161461157d576040805162461bcd60e51b815260206004820181905260248201526000805160206123e6833981519152604482015290519081900360640190fd5b600980546001600160a01b0384166001600160a01b031990911681179091556040805160208082526007908201526619995959195cdd60ca1b8183015290516000805160206124708339815191529181900360600190a25090565b60006115e2611c6f565b6000546001600160a01b03908116911614611632576040805162461bcd60e51b815260206004820181905260248201526000805160206123e6833981519152604482015290519081900360640190fd5b600b80546001600160a01b0384166001600160a01b0319918216811790925560078054909116821781556040805160208082528101929092526653544b4141564560c81b82820152516000805160206124708339815191529181900360600190a250506007546001600160a01b031690565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b600654600754604080516370a0823160e01b815230600482015290516101009093046001600160a01b039081169392169160009184916370a0823191602480820192602092909190829003018186803b15801561172b57600080fd5b505afa15801561173f573d6000803e3d6000fd5b505050506040513d602081101561175557600080fd5b5051604080516370a0823160e01b815230600482015290519192506000916001600160a01b038516916370a08231916024808301926020929190829003018186803b1580156117a357600080fd5b505afa1580156117b7573d6000803e3d6000fd5b505050506040513d60208110156117cd57600080fd5b5051905081810160006117de61067d565b905060006117f083610a5b8a85611fb4565b9050611388600a8202046001811161183f576040805162461bcd60e51b815260206004820152600d60248201526c4665653a556e70617961626c6560981b604482015290519081900360640190fd5b6040805163a9059cbb60e01b81523360048201528284036024820181905291516001600160a01b038b169163a9059cbb9160448083019260209291908290030181600087803b15801561189157600080fd5b505af11580156118a5573d6000803e3d6000fd5b505050506040513d60208110156118bb57600080fd5b506118c89050338b61204f565b604080518b8152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a250505050505050505050565b600654600754604080516370a0823160e01b815230600482015290516000936001600160a01b036101009091048116931691849184916370a08231916024808301926020929190829003018186803b15801561196557600080fd5b505afa158015611979573d6000803e3d6000fd5b505050506040513d602081101561198f57600080fd5b5051604080516370a0823160e01b815230600482015290519192506000916001600160a01b038516916370a08231916024808301926020929190829003018186803b1580156119dd57600080fd5b505afa1580156119f1573d6000803e3d6000fd5b505050506040513d6020811015611a0757600080fd5b505190508181016000611a1861067d565b9050801580611a25575081155b15611a3957611a34338961214b565b611b13565b6000611a4983610a5b8b85611fb4565b9050611388600a82020460018111611a98576040805162461bcd60e51b815260206004820152600d60248201526c4665653a556e70617961626c6560981b604482015290519081900360640190fd5b808203611aa5338261214b565b600954611abb906001600160a01b03168361214b565b60408051828152905133916000805160206124b5833981519152919081900360200190a26009546040805184815290516001600160a01b03909216916000805160206124b58339815191529181900360200190a25050505b604080516323b872dd60e01b8152336004820152306024820152604481018a905290516001600160a01b038816916323b872dd9160648083019260209291908290030181600087803b158015610e9857600080fd5b611b70611c6f565b6000546001600160a01b03908116911614611bc0576040805162461bcd60e51b815260206004820181905260248201526000805160206123e6833981519152604482015290519081900360640190fd5b6001600160a01b038116611c055760405162461bcd60e51b815260040180806020018281038252602681526020018061232f6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6009546001600160a01b031681565b3390565b6001600160a01b038316611cb85760405162461bcd60e51b815260040180806020018281038252602481526020018061244c6024913960400191505060405180910390fd5b6001600160a01b038216611cfd5760405162461bcd60e51b81526004018080602001828103825260228152602001806123556022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316611da45760405162461bcd60e51b81526004018080602001828103825260258152602001806124276025913960400191505060405180910390fd5b6001600160a01b038216611de95760405162461bcd60e51b81526004018080602001828103825260238152602001806122ea6023913960400191505060405180910390fd5b611df483838361223d565b611e3181604051806060016040528060268152602001612377602691396001600160a01b0386166000908152600160205260409020549190611ebc565b6001600160a01b038085166000908152600160205260408082209390935590841681522054611e609082611f53565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115611f4b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611f10578181015183820152602001611ef8565b50505050905090810190601f168015611f3d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015611fad576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600082611fc357506000610677565b82820282848281611fd057fe5b0414611fad5760405162461bcd60e51b815260040180806020018281038252602181526020018061239d6021913960400191505060405180910390fd5b6000611fad83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612242565b6001600160a01b0382166120945760405162461bcd60e51b81526004018080602001828103825260218152602001806124066021913960400191505060405180910390fd5b6120a08260008361223d565b6120dd8160405180606001604052806022815260200161230d602291396001600160a01b0385166000908152600160205260409020549190611ebc565b6001600160a01b03831660009081526001602052604090205560035461210390826122a7565b6003556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b0382166121a6576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6121b26000838361223d565b6003546121bf9082611f53565b6003556001600160a01b0382166000908152600160205260409020546121e59082611f53565b6001600160a01b03831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b505050565b600081836122915760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611f10578181015183820152602001611ef8565b50600083858161229d57fe5b0495945050505050565b6000611fad83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ebc56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a785fc346da73c9ad6c933dde68fe85362a97b7b07706c3e23ff3400cc5d93b545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885a26469706673582212203aff4e57c4f0be93f3748cd280bc745b3de7b59317294595edeb531c4f5da0fc64736f6c634300060c0033

Verified Source Code Partial Match

Compiler: v0.6.12+commit.27d51765 EVM: istanbul Optimization: Yes (200 runs)
wrappedAAVE.sol 733 lines
pragma solidity ^0.6.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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @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 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}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
 contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(_owner == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}
interface IDelegationToken {
  function delegate(address delegatee) external;
}
interface IStakedAave {
  function stake(address to, uint256 amount) external;

  function redeem(address to, uint256 amount) external;

  function cooldown() external;

  function claimRewards(address to, uint256 amount) external;
  
  function delegate(address delegatee) external;
}
contract wrappedAAVE is Context, IERC20, Ownable {
    using SafeMath for uint256;
    mapping (address => uint256) private _balances;
    mapping (address => mapping (address => uint256)) private _allowances;
    uint256 private _totalSupply;
    string private _name;
    string private _symbol;
    uint8 private _decimals;
    address public _aaveAddress;
    address public _stkaaveAddress;
    address public _delegation;
    address public _feedest;
    constructor (string memory name, string memory symbol) public {
        _name = name;
        _symbol = symbol;
        _decimals = 18;
    }
        IDelegationToken AAVEaddx;
        IStakedAave STKAAVEaddx;
    event Mint(address indexed sender, uint amount0);
    event Burn(address indexed sender, uint amount0);
    event Change(address indexed to,string func);
    event Rewards(uint256 amount);
    function setFeeDest(address val) onlyOwner public returns(address){
        _feedest = val;
        emit Change(val,"feedest");
        return val;
    }
    function setAAVEAddress(address AAVEAddress) onlyOwner public returns(address) {
        AAVEaddx = IDelegationToken(AAVEAddress);
        _aaveAddress = AAVEAddress;
        emit Change(AAVEAddress,"AAVE");
        return _aaveAddress;
    }
    function setSTKAAVEAddress(address STKAAVEAddress) onlyOwner public returns(address) {
        STKAAVEaddx = IStakedAave(STKAAVEAddress);
        _stkaaveAddress = STKAAVEAddress;
        emit Change(STKAAVEAddress,"STKAAVE");
        return _stkaaveAddress;
    }
    function setdelegation(address _val) onlyOwner public returns (address result) {
        STKAAVEaddx.delegate(_val);
        AAVEaddx.delegate(_val);
        _delegation = _val;
        emit Change(_val,"delegation");
        return _val;
    }
    function claimStakingRewards(uint256 amt) onlyOwner public{
        uint256 fees = (amt*10)/5000;
        uint256 receivable = amt-fees;
        STKAAVEaddx.claimRewards(_feedest,fees);
        STKAAVEaddx.claimRewards(address(this),receivable);
        emit Rewards(amt);
        }
    function stake(uint256 amt) onlyOwner public returns(bool result){
        IERC20 token;
        token = IERC20(_aaveAddress);
        token.approve(_stkaaveAddress,amt);
        STKAAVEaddx.stake(msg.sender,amt);
        return true;
    }
    function activateUnstakingCooldown() onlyOwner public returns(bool result){
        STKAAVEaddx.cooldown();
        return true;
    }
    function unstake(uint256 amt) onlyOwner public returns(bool result){
        STKAAVEaddx.redeem(msg.sender,amt);
        return true;
    }
    function wrap(uint256 amount) public returns (uint256) {
        IERC20 aave;
        IERC20 stkaave;
        aave = IERC20(_aaveAddress);
        stkaave = IERC20(_stkaaveAddress);
        uint256 Aave = aave.balanceOf(address(this));
        uint256 Stk = stkaave.balanceOf(address(this));
        uint256 totalAave = Aave+Stk;
        // Gets the amount of Ghost Farm in existence
        uint256 totalShares = totalSupply();
        // If no Ghost Farm exists, mint it 1:1 to the amount put in
        if (totalShares == 0 || totalAave == 0) {
            _mint(msg.sender, amount);
        } 
        // Calculate and mint the amount of Ghost Farm the AAVE is worth. The ratio will change overtime, as Ghost Farm is burned/minted and Aave deposited + gained from fees / withdrawn.
        else {
            uint256 what = amount.mul(totalShares).div(totalAave);
            uint256 fees = (what*10)/5000;
        require(fees>1,"Fee:Unpayable");
        uint256 receivable = what-fees;
            _mint(msg.sender, receivable);
            _mint(_feedest, fees);
            emit Mint(msg.sender,receivable);
            emit Mint(_feedest,fees);
        }
        require(aave.transferFrom(msg.sender, address(this), amount),"Not enough tokens!");
        return amount;
    }
    function wrapSTKAAVE(uint256 amount) public returns (uint256) {
        
        IERC20 aave;
        IERC20 stkaave;
        aave = IERC20(_aaveAddress);
        stkaave = IERC20(_stkaaveAddress);
        uint256 Aave = aave.balanceOf(address(this));
        uint256 Stk = stkaave.balanceOf(address(this));
        uint256 totalAave = Aave+Stk;
        // Gets the amount of Ghost Farm in existence
        uint256 totalShares = totalSupply();
        // If no Ghost Farm exists, mint it 1:1 to the amount put in
        if (totalShares == 0 || totalAave == 0) {
            _mint(msg.sender, amount);
        } 
        // Calculate and mint the amount of Ghost Farm the AAVE is worth. The ratio will change overtime, as Ghost Farm is burned/minted and Aave deposited + gained from fees / withdrawn.
        else {
            uint256 what = amount.mul(totalShares).div(totalAave);
            uint256 fees = (what*10)/5000;
        require(fees>1,"Fee:Unpayable");
        uint256 receivable = what-fees;
            _mint(msg.sender, receivable);
            _mint(_feedest, fees);
            emit Mint(msg.sender,receivable);
            emit Mint(_feedest,fees);
        }
        require(stkaave.transferFrom(msg.sender, address(this), amount),"Not enough tokens!");
        return amount;
    }
    function unwrap(uint256 amount) public {
        IERC20 aave;
        IERC20 stkaave;
        aave = IERC20(_aaveAddress);
        stkaave = IERC20(_stkaaveAddress);
        uint256 Aave = aave.balanceOf(address(this));
        uint256 Stk = stkaave.balanceOf(address(this));
        uint256 totalAave = Aave+Stk;
        // Gets the amount of Ghost Farm in existence
        uint256 totalShares = totalSupply();
        // Calculates the amount of Aave the Ghost Farm is worth
        uint256 what = amount.mul(totalShares).div(totalAave);
        uint256 fees = (what*10)/5000;
        require(fees>1,"Fee:Unpayable");
        uint256 receivable = what-fees;
        aave.transfer(msg.sender,receivable);
        _burn(msg.sender, amount);
        emit Burn(msg.sender,amount);
    }
    function unwrapSTKAAVE(uint256 amount) public returns (uint256) {
        IERC20 aave;
        IERC20 stkaave;
        aave = IERC20(_aaveAddress);
        stkaave = IERC20(_stkaaveAddress);
        uint256 Aave = aave.balanceOf(address(this));
        uint256 Stk = stkaave.balanceOf(address(this));
        uint256 totalAave = Aave+Stk;
        // Gets the amount of Ghost Farm in existence
        uint256 totalShares = totalSupply();
        // Calculates the amount of Aave the Ghost Farm is worth
        uint256 what = amount.mul(totalShares).div(totalAave);
        uint256 fees = (what*10)/5000;
        require(fees>1,"Fee:Unpayable");
        uint256 receivable = what-fees;
        stkaave.transfer(msg.sender,receivable);
        _burn(msg.sender, amount);
        emit Burn(msg.sender,amount);
    }
    function name() public view returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view 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 value {ERC20} uses, unless {_setupDecimals} is
     * called.
     *
     * 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 returns (uint8) {
        return _decimals;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view override returns (uint256) {
        return _totalSupply;
    }
    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view override returns (uint256) {
        return _balances[account];
    }
    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");
        _beforeTokenTransfer(account, address(0), amount);
        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` 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.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal {
        _decimals = decimals_;
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}

Read Contract

_aaveAddress 0x5f708443 → address
_delegation 0x3b6cbfb1 → address
_feedest 0xf8f2be7f → address
_stkaaveAddress 0x6540a1a9 → address
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
name 0x06fdde03 → string
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256

Write Contract 19 functions

These functions modify contract state and require a wallet transaction to execute.

activateUnstakingCooldown 0xc19330df
No parameters
returns: bool
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
claimStakingRewards 0x8fad2627
uint256 amt
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
renounceOwnership 0x715018a6
No parameters
setAAVEAddress 0x196e3892
address AAVEAddress
returns: address
setFeeDest 0xce937499
address val
returns: address
setSTKAAVEAddress 0xdb0a8d50
address STKAAVEAddress
returns: address
setdelegation 0x85d79a79
address _val
returns: address
stake 0xa694fc3a
uint256 amt
returns: bool
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
unstake 0x2e17de78
uint256 amt
returns: bool
unwrap 0xde0e9a3e
uint256 amount
unwrapSTKAAVE 0x6e388959
uint256 amount
returns: uint256
wrap 0xea598cb0
uint256 amount
returns: uint256
wrapSTKAAVE 0x797260a9
uint256 amount
returns: uint256

Recent Transactions

No transactions found for this address