diff --git a/README.md b/README.md index 34e14a5f..efca06ce 100644 --- a/README.md +++ b/README.md @@ -55,9 +55,9 @@ If no direct liquidity pair exists between two tokens, the spot price aggregator * YVault - [0x9FF110f132d988bfa9bC6a21851Da1aF3aC6EaF8](https://etherscan.io/address/0x9FF110f132d988bfa9bC6a21851Da1aF3aC6EaF8) * stETH - [0x26daCf7E879b18FE658326ddD3ABC0D6910B3E9F](https://etherscan.io/address/0x26daCf7E879b18FE658326ddD3ABC0D6910B3E9F) * wstETH - [0x37eB78fE793E89353e46AEe73E299985C3B8d334](https://etherscan.io/address/0x37eB78fE793E89353e46AEe73E299985C3B8d334) - * sDAI - [0xF07317368A4B061dadB8C8239cbfCfd4808B76ce](https://etherscan.io/address/0xF07317368A4B061dadB8C8239cbfCfd4808B76ce) * CHAI - [0x6fE4926a0fCc78ab764b39f2738e1Dea145d7AC0](https://etherscan.io/address/0x6fE4926a0fCc78ab764b39f2738e1Dea145d7AC0) - * sUSDe - [0x6b4A160c09E7acCB2Ceb881E52409a01731d112c](https://etherscan.io/address/0x6b4A160c09E7acCB2Ceb881E52409a01731d112c) + * Erc4626 - [0xE2B06CDBB6128347B11DE676DA8b51e1e1f7F76E](https://etherscan.io/address/0xE2B06CDBB6128347B11DE676DA8b51e1e1f7F76E) + * [sUSDe](https://etherscan.io/address/0x9D39A5DE30e57443BfF2A8307A4256c8797A3497), [sDAI](https://etherscan.io/address/0x83F20F44975D03b1b09e64809B757c47f942BEeA), [xrETH](https://etherscan.io/address/0xBB22d59B73D7a6F3A8a83A214BECc67Eb3b511fE), [scrvUSD](https://etherscan.io/address/0x0655977FEb2f289A4aB78af67BAB0d17aAb84367) @@ -635,7 +635,8 @@ If no direct liquidity pair exists between two tokens, the spot price aggregator * AaveV3 - [0x0c8fc7a71C28c768FDC1f7d75835229beBEB1573](https://basescan.org/address/0x0c8fc7a71C28c768FDC1f7d75835229beBEB1573) * StataTokens (AaveV3) - [0x1A75DF59f464a70Cc8f7383983852FF72e5F5167](https://basescan.org/address/0x1A75DF59f464a70Cc8f7383983852FF72e5F5167) * CompoundV3 - [0x3afA12cf9Ac1a96845973BD93dBEa183A94DD74F](https://basescan.org/address/0x3afA12cf9Ac1a96845973BD93dBEa183A94DD74F) - * wsuperOETHb - [0x82534c42D6F7C347503C6618170A9aA7d382D8Ec](https://basescan.org/address/0x82534c42D6F7C347503C6618170A9aA7d382D8Ec) + * Erc4626 - [0xE2B06CDBB6128347B11DE676DA8b51e1e1f7F76E](https://basescan.org/address/0xE2B06CDBB6128347B11DE676DA8b51e1e1f7F76E) + * [wsuperOETHb](https://basescan.org/address/0x7FcD174E80f264448ebeE8c88a7C4476AAF58Ea6) diff --git a/contracts/interfaces/ISDai.sol b/contracts/interfaces/ISDai.sol deleted file mode 100644 index cbd6a635..00000000 --- a/contracts/interfaces/ISDai.sol +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.23; - -interface ISDai { - function previewDeposit(uint256 assets) external view returns (uint256); - function previewRedeem(uint256 shares) external view returns (uint256); -} - diff --git a/contracts/wrappers/SDaiWrapper.sol b/contracts/wrappers/SDaiWrapper.sol deleted file mode 100644 index 0fbeec69..00000000 --- a/contracts/wrappers/SDaiWrapper.sol +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.23; - -import "../interfaces/ISDai.sol"; -import "./Wrapper.sol"; - -contract SDaiWrapper is Wrapper { - constructor(IERC20 base, IERC20 wBase) Wrapper(base, wBase) {} // solhint-disable-line no-empty-blocks - - function _wrap() internal view override returns (IERC20 wrappedToken, uint256 rate) { - return (WBASE, ISDai(address(WBASE)).previewDeposit(1e18)); - } - - function _unwrap() internal view override returns (IERC20 unwrappedToken, uint256 rate) { - return (BASE, ISDai(address(WBASE)).previewRedeem(1e18)); - } -} diff --git a/contracts/wrappers/SUSDeWrapper.sol b/contracts/wrappers/SUSDeWrapper.sol deleted file mode 100644 index ae393801..00000000 --- a/contracts/wrappers/SUSDeWrapper.sol +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.23; - -import "./Wrapper.sol"; -import "@openzeppelin/contracts/interfaces/IERC4626.sol"; - -contract SUSDeWrapper is Wrapper { - - constructor(IERC20 base, IERC20 wBase) Wrapper(base, wBase) {} // solhint-disable-line no-empty-blocks - - function _wrap() internal view virtual override returns (IERC20 wrappedToken, uint256 rate) { - return (WBASE, IERC4626(address(WBASE)).convertToShares(1e18)); // scale down when minting sUSDe with USDe - } - - function _unwrap() internal view virtual override returns (IERC20 unwrappedToken, uint256 rate) { - return (BASE, IERC4626(address(WBASE)).convertToAssets(1e18)); // scale up when redeeming sUSDe for USDe - } -} diff --git a/contracts/wrappers/WsuperOETHbWrapper.sol b/contracts/wrappers/WsuperOETHbWrapper.sol deleted file mode 100644 index 5dbdabb0..00000000 --- a/contracts/wrappers/WsuperOETHbWrapper.sol +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity 0.8.23; - -import "./SDaiWrapper.sol"; - -contract WsuperOETHbWrapper is SDaiWrapper { - constructor(IERC20 base, IERC20 wBase) SDaiWrapper(base, wBase) {} // solhint-disable-line no-empty-blocks -} diff --git a/deployments/base/Erc4626Wrapper.json b/deployments/base/Erc4626Wrapper.json new file mode 100644 index 00000000..d2ed150f --- /dev/null +++ b/deployments/base/Erc4626Wrapper.json @@ -0,0 +1,249 @@ +{ + "address": "0xE2B06CDBB6128347B11DE676DA8b51e1e1f7F76E", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "NotAddedMarket", + "type": "error" + }, + { + "inputs": [], + "name": "NotRemovedMarket", + "type": "error" + }, + { + "inputs": [], + "name": "NotSupportedToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "addMarkets", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "assosiatedToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "baseToWbase", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "removeMarkets", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "wbaseToBase", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + } + ], + "name": "wrap", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "wrappedToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "rate", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x72496ff717c835b15e7265d0dd7203b079b5e16621008d92aebb89af6cc9ec76", + "receipt": { + "to": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", + "from": "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF", + "contractAddress": null, + "transactionIndex": 41, + "gasUsed": "654006", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000004000000000000000000000004000000000000008000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000001000000000000000000002000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xcf01bc6ea181c2250a6df97779acc3787660f3400def2807f78d64aab6f08dec", + "transactionHash": "0x72496ff717c835b15e7265d0dd7203b079b5e16621008d92aebb89af6cc9ec76", + "logs": [ + { + "_type": "log", + "address": "0xE2B06CDBB6128347B11DE676DA8b51e1e1f7F76E", + "blockHash": "0xcf01bc6ea181c2250a6df97779acc3787660f3400def2807f78d64aab6f08dec", + "blockNumber": 22416627, + "data": "0x", + "index": 145, + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000056e44874f624ebde6efcc783efd685f0fbdc6dcf" + ], + "transactionHash": "0x72496ff717c835b15e7265d0dd7203b079b5e16621008d92aebb89af6cc9ec76", + "transactionIndex": 41 + } + ], + "blockNumber": 22416627, + "cumulativeGasUsed": "10076714", + "status": 1 + }, + "args": [ + "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF" + ], + "numDeployments": 1, + "bytecode": "0x6080346100b957601f610a6538819003918201601f19168301916001600160401b038311848410176100bd578084926020946040528339810103126100b957516001600160a01b0390818116908190036100b95780156100a1575f80546001600160a01b03198116831782556040519316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a361099390816100d28239f35b604051631e4fbdf760e01b81525f6004820152602490fd5b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe60406080815260049081361015610014575f80fd5b5f3560e01c8063023276f0146105bd5780631471c9221461055657806343654a30146104ef5780634895028514610488578063715018a6146103ee5780638da5cb5b1461039d578063bfef7bdf1461028c578063da40385d146101645763f2fde38b1461007f575f80fd5b346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101605781359173ffffffffffffffffffffffffffffffffffffffff91828416809403610160576100d961090d565b83156101315750505f54827fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b905f60249251917f1e4fbdf7000000000000000000000000000000000000000000000000000000008352820152fd5b5f80fd5b5090346101605761017436610694565b61017c61090d565b5f5b815181101561028a5773ffffffffffffffffffffffffffffffffffffffff90816101a882856108a0565b511691855180937f38d52e0f000000000000000000000000000000000000000000000000000000008252818760209384935afa801561028057826002916001965f91610253575b501691836101fd86896108a0565b51165f5260038152885f20937fffffffffffffffffffffffff000000000000000000000000000000000000000094848682541617905561023d86896108a0565b5116925f5252865f20918254161790550161017e565b6102739150843d8611610279575b61026b8183610626565b8101906108e1565b5f6101ef565b503d610261565b87513d5f823e3d90fd5b005b5034610160579061029c36610694565b916102a561090d565b5f925b805184101561028a5773ffffffffffffffffffffffffffffffffffffffff93846102d282846108a0565b511694835180967f38d52e0f000000000000000000000000000000000000000000000000000000008252818760209384935afa908115610393576001949596975f92610373575b50826002929361032986896108a0565b51165f5260038252875f20937fffffffffffffffffffffffff000000000000000000000000000000000000000094858154169055165f5252845f20908154169055019291906102a8565b6002925061038d90823d84116102795761026b8183610626565b91610319565b85513d5f823e3d90fd5b5034610160575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101605760209073ffffffffffffffffffffffffffffffffffffffff5f54169051908152f35b34610160575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101605761042461090d565b5f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b5090346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261016057359073ffffffffffffffffffffffffffffffffffffffff808316809303610160576020925f5260018352815f2054169051908152f35b5090346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261016057359073ffffffffffffffffffffffffffffffffffffffff808316809303610160576020925f5260038352815f2054169051908152f35b5090346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261016057359073ffffffffffffffffffffffffffffffffffffffff808316809303610160576020925f5260028352815f2054169051908152f35b5090346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610160573573ffffffffffffffffffffffffffffffffffffffff9081811681036101605761061790610752565b90918351921682526020820152f35b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761066757604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101605767ffffffffffffffff916004358381116101605781602382011215610160578060040135938411610667578360051b90604051946107006020840187610626565b85526024602086019282010192831161016057602401905b828210610726575050505090565b813573ffffffffffffffffffffffffffffffffffffffff81168103610160578152908301908301610718565b9073ffffffffffffffffffffffffffffffffffffffff80921691825f5260206003815260409382855f2054169260028352855f2054168315155f1461081e575090806024928651938480927f07a2d13a000000000000000000000000000000000000000000000000000000008252670de0b6b3a764000060048301525afa94851561081557505f946107e5575b50509190565b9080929450813d831161080e575b6107fd8183610626565b810103126101605751915f806107df565b503d6107f3565b513d5f823e3d90fd5b9250508115610877578351907fc6e6f592000000000000000000000000000000000000000000000000000000008252670de0b6b3a764000060048301528082602481865afa94851561081557505f946107e55750509190565b600484517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b80518210156108b45760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b90816020910312610160575173ffffffffffffffffffffffffffffffffffffffff811681036101605790565b73ffffffffffffffffffffffffffffffffffffffff5f5416330361092d57565b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fdfea26469706673582212202d6af06104b044e3eac63a94c2d7e00f99fb716f8d37e328b2fc1368f26e2e6a64736f6c63430008170033", + "deployedBytecode": "0x60406080815260049081361015610014575f80fd5b5f3560e01c8063023276f0146105bd5780631471c9221461055657806343654a30146104ef5780634895028514610488578063715018a6146103ee5780638da5cb5b1461039d578063bfef7bdf1461028c578063da40385d146101645763f2fde38b1461007f575f80fd5b346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101605781359173ffffffffffffffffffffffffffffffffffffffff91828416809403610160576100d961090d565b83156101315750505f54827fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b905f60249251917f1e4fbdf7000000000000000000000000000000000000000000000000000000008352820152fd5b5f80fd5b5090346101605761017436610694565b61017c61090d565b5f5b815181101561028a5773ffffffffffffffffffffffffffffffffffffffff90816101a882856108a0565b511691855180937f38d52e0f000000000000000000000000000000000000000000000000000000008252818760209384935afa801561028057826002916001965f91610253575b501691836101fd86896108a0565b51165f5260038152885f20937fffffffffffffffffffffffff000000000000000000000000000000000000000094848682541617905561023d86896108a0565b5116925f5252865f20918254161790550161017e565b6102739150843d8611610279575b61026b8183610626565b8101906108e1565b5f6101ef565b503d610261565b87513d5f823e3d90fd5b005b5034610160579061029c36610694565b916102a561090d565b5f925b805184101561028a5773ffffffffffffffffffffffffffffffffffffffff93846102d282846108a0565b511694835180967f38d52e0f000000000000000000000000000000000000000000000000000000008252818760209384935afa908115610393576001949596975f92610373575b50826002929361032986896108a0565b51165f5260038252875f20937fffffffffffffffffffffffff000000000000000000000000000000000000000094858154169055165f5252845f20908154169055019291906102a8565b6002925061038d90823d84116102795761026b8183610626565b91610319565b85513d5f823e3d90fd5b5034610160575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101605760209073ffffffffffffffffffffffffffffffffffffffff5f54169051908152f35b34610160575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101605761042461090d565b5f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b5090346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261016057359073ffffffffffffffffffffffffffffffffffffffff808316809303610160576020925f5260018352815f2054169051908152f35b5090346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261016057359073ffffffffffffffffffffffffffffffffffffffff808316809303610160576020925f5260038352815f2054169051908152f35b5090346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261016057359073ffffffffffffffffffffffffffffffffffffffff808316809303610160576020925f5260028352815f2054169051908152f35b5090346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610160573573ffffffffffffffffffffffffffffffffffffffff9081811681036101605761061790610752565b90918351921682526020820152f35b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761066757604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101605767ffffffffffffffff916004358381116101605781602382011215610160578060040135938411610667578360051b90604051946107006020840187610626565b85526024602086019282010192831161016057602401905b828210610726575050505090565b813573ffffffffffffffffffffffffffffffffffffffff81168103610160578152908301908301610718565b9073ffffffffffffffffffffffffffffffffffffffff80921691825f5260206003815260409382855f2054169260028352855f2054168315155f1461081e575090806024928651938480927f07a2d13a000000000000000000000000000000000000000000000000000000008252670de0b6b3a764000060048301525afa94851561081557505f946107e5575b50509190565b9080929450813d831161080e575b6107fd8183610626565b810103126101605751915f806107df565b503d6107f3565b513d5f823e3d90fd5b9250508115610877578351907fc6e6f592000000000000000000000000000000000000000000000000000000008252670de0b6b3a764000060048301528082602481865afa94851561081557505f946107e55750509190565b600484517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b80518210156108b45760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b90816020910312610160575173ffffffffffffffffffffffffffffffffffffffff811681036101605790565b73ffffffffffffffffffffffffffffffffffffffff5f5416330361092d57565b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fdfea26469706673582212202d6af06104b044e3eac63a94c2d7e00f99fb716f8d37e328b2fc1368f26e2e6a64736f6c63430008170033" +} \ No newline at end of file diff --git a/deployments/base/WsuperOETHbWrapper.json b/deployments/base/WsuperOETHbWrapper.json deleted file mode 100644 index ab2fd995..00000000 --- a/deployments/base/WsuperOETHbWrapper.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "address": "0x82534c42D6F7C347503C6618170A9aA7d382D8Ec", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "base", - "type": "address" - }, - { - "internalType": "contract IERC20", - "name": "wBase", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "NotAddedMarket", - "type": "error" - }, - { - "inputs": [], - "name": "NotRemovedMarket", - "type": "error" - }, - { - "inputs": [], - "name": "NotSupportedToken", - "type": "error" - }, - { - "inputs": [], - "name": "BASE", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "WBASE", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "token", - "type": "address" - } - ], - "name": "wrap", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "wrappedToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "rate", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xb9710d5044075a6ffe8bb6884d9d7ad655c7914949380da125420035e663ee26", - "receipt": { - "to": null, - "from": "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF", - "contractAddress": "0x82534c42D6F7C347503C6618170A9aA7d382D8Ec", - "transactionIndex": 35, - "gasUsed": "262302", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x9850ba8b7bed5e32ee32320bf63148635481a2f1d430cf00a0d72e7a6f579e19", - "transactionHash": "0xb9710d5044075a6ffe8bb6884d9d7ad655c7914949380da125420035e663ee26", - "logs": [], - "blockNumber": 21366967, - "cumulativeGasUsed": "8317252", - "status": 1, - "byzantium": true - }, - "args": [ - "0xDBFeFD2e8460a6Ee4955A68582F85708BAEA60A3", - "0x7FcD174E80f264448ebeE8c88a7C4476AAF58Ea6" - ], - "numDeployments": 1, - "solcInputHash": "1387c6738d41087a950f3910d50e1c1c", - "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"base\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"wBase\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"NotAddedMarket\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotRemovedMarket\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotSupportedToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BASE\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WBASE\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"wrap\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"wrappedToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rate\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/wrappers/WsuperOETHbWrapper.sol\":\"WsuperOETHbWrapper\"},\"evmVersion\":\"shanghai\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xc6a8ff0ea489379b61faa647490411b80102578440ab9d84e9a957cc12164e70\",\"license\":\"MIT\"},\"contracts/interfaces/ISDai.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\ninterface ISDai {\\n function previewDeposit(uint256 assets) external view returns (uint256);\\n function previewRedeem(uint256 shares) external view returns (uint256);\\n}\\n\\n\",\"keccak256\":\"0xde76bb7c27b63bf450cf229901db7258fc9cc3aa72a8c590b1c885daa591487b\",\"license\":\"MIT\"},\"contracts/interfaces/IWrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IWrapper {\\n error NotSupportedToken();\\n error NotAddedMarket();\\n error NotRemovedMarket();\\n\\n function wrap(IERC20 token) external view returns (IERC20 wrappedToken, uint256 rate);\\n}\\n\",\"keccak256\":\"0x1d3cefe7c67b9f9750823be723dd0b00f9894ec4e0cd078eac321a2cff8f7da2\",\"license\":\"MIT\"},\"contracts/wrappers/SDaiWrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport \\\"../interfaces/ISDai.sol\\\";\\nimport \\\"./Wrapper.sol\\\";\\n\\ncontract SDaiWrapper is Wrapper {\\n constructor(IERC20 base, IERC20 wBase) Wrapper(base, wBase) {} // solhint-disable-line no-empty-blocks\\n\\n function _wrap() internal view override returns (IERC20 wrappedToken, uint256 rate) {\\n return (WBASE, ISDai(address(WBASE)).previewDeposit(1e18));\\n }\\n\\n function _unwrap() internal view override returns (IERC20 unwrappedToken, uint256 rate) {\\n return (BASE, ISDai(address(WBASE)).previewRedeem(1e18));\\n }\\n}\\n\",\"keccak256\":\"0x32368fd49dee3f060feb7dbf737f6db2489b479bffc3be1422d00573cd93a0cd\",\"license\":\"MIT\"},\"contracts/wrappers/Wrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport \\\"../interfaces/IWrapper.sol\\\";\\n\\nabstract contract Wrapper is IWrapper {\\n IERC20 public immutable BASE;\\n IERC20 public immutable WBASE;\\n\\n constructor(IERC20 base, IERC20 wBase) {\\n BASE = base;\\n WBASE = wBase;\\n }\\n\\n function wrap(IERC20 token) external view override returns (IERC20 wrappedToken, uint256 rate) {\\n if(token == BASE) {\\n return _wrap();\\n } else if (token == WBASE) {\\n return _unwrap();\\n } else {\\n revert NotSupportedToken();\\n }\\n }\\n\\n function _wrap() internal view virtual returns (IERC20 wrappedToken, uint256 rate) {} // solhint-disable-line no-empty-blocks\\n\\n function _unwrap() internal view virtual returns (IERC20 unwrappedToken, uint256 rate) {} // solhint-disable-line no-empty-blocks\\n}\\n\",\"keccak256\":\"0xfcd599a5fd47efb91353766756707072756da2f2682f6e54b2ae525a71fc1ffb\",\"license\":\"MIT\"},\"contracts/wrappers/WsuperOETHbWrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport \\\"./SDaiWrapper.sol\\\";\\n\\ncontract WsuperOETHbWrapper is SDaiWrapper {\\n constructor(IERC20 base, IERC20 wBase) SDaiWrapper(base, wBase) {} // solhint-disable-line no-empty-blocks\\n}\\n\",\"keccak256\":\"0x56a5ae3fb03121e33d5a743dd67b674f9dec3ba9b6c1a027bfcfc38fbf12a36f\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60c03461008d57601f61047f38819003918201601f19168301916001600160401b0383118484101761009157808492604094855283398101031261008d57610052602061004b836100a5565b92016100a5565b9060805260a0526040516103c590816100ba8239608051818181608401526101a0015260a05181818160f6015281816101d1015261027d0152f35b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b038216820361008d5756fe60806040526004361015610011575f80fd5b5f3560e01c8063023276f01461011a5780638e0b3bf2146100ac5763ec342ad01461003a575f80fd5b346100a8575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a857602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5f80fd5b346100a8575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a857602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b346100a85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a85760043573ffffffffffffffffffffffffffffffffffffffff80821682036100a857610175604092610184565b90918351921682526020820152f35b73ffffffffffffffffffffffffffffffffffffffff90811691907f0000000000000000000000000000000000000000000000000000000000000000818116840361027a57506024925060207f000000000000000000000000000000000000000000000000000000000000000091604051948580927fef8b30f7000000000000000000000000000000000000000000000000000000008252670de0b6b3a7640000600483015285165afa92831561026f575f9361023f57509190565b9092506020813d602011610267575b8161025b60209383610321565b810103126100a8575190565b3d915061024e565b6040513d5f823e3d90fd5b907f0000000000000000000000000000000000000000000000000000000000000000168093145f146102f7576020602493604051948580927f4cdad506000000000000000000000000000000000000000000000000000000008252670de0b6b3a764000060048301525afa92831561026f575f9361023f57509190565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761036257604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffdfea2646970667358221220353917ab144254fdc3e34c7a94e63f3c45ec5c449d07034838eaf61d48131c4c64736f6c63430008170033", - "deployedBytecode": "0x60806040526004361015610011575f80fd5b5f3560e01c8063023276f01461011a5780638e0b3bf2146100ac5763ec342ad01461003a575f80fd5b346100a8575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a857602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5f80fd5b346100a8575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a857602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b346100a85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a85760043573ffffffffffffffffffffffffffffffffffffffff80821682036100a857610175604092610184565b90918351921682526020820152f35b73ffffffffffffffffffffffffffffffffffffffff90811691907f0000000000000000000000000000000000000000000000000000000000000000818116840361027a57506024925060207f000000000000000000000000000000000000000000000000000000000000000091604051948580927fef8b30f7000000000000000000000000000000000000000000000000000000008252670de0b6b3a7640000600483015285165afa92831561026f575f9361023f57509190565b9092506020813d602011610267575b8161025b60209383610321565b810103126100a8575190565b3d915061024e565b6040513d5f823e3d90fd5b907f0000000000000000000000000000000000000000000000000000000000000000168093145f146102f7576020602493604051948580927f4cdad506000000000000000000000000000000000000000000000000000000008252670de0b6b3a764000060048301525afa92831561026f575f9361023f57509190565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761036257604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffdfea2646970667358221220353917ab144254fdc3e34c7a94e63f3c45ec5c449d07034838eaf61d48131c4c64736f6c63430008170033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/mainnet/Erc4626Wrapper.json b/deployments/mainnet/Erc4626Wrapper.json new file mode 100644 index 00000000..1e105006 --- /dev/null +++ b/deployments/mainnet/Erc4626Wrapper.json @@ -0,0 +1,249 @@ +{ + "address": "0xE2B06CDBB6128347B11DE676DA8b51e1e1f7F76E", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "NotAddedMarket", + "type": "error" + }, + { + "inputs": [], + "name": "NotRemovedMarket", + "type": "error" + }, + { + "inputs": [], + "name": "NotSupportedToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "addMarkets", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "assosiatedToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "baseToWbase", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "removeMarkets", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "wbaseToBase", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + } + ], + "name": "wrap", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "wrappedToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "rate", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xe9aade571e8efacaba118f85e6cec4b098e28f461c3b63d3c877e65520d70277", + "receipt": { + "to": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", + "from": "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF", + "contractAddress": null, + "transactionIndex": 88, + "gasUsed": "654006", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000004000000000000000000000004000000000000008000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000001000000000000000000002000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xadc922dddf7b760f4c36633a3e568b82e5b3700d96816b123f713480980fdd8d", + "transactionHash": "0xe9aade571e8efacaba118f85e6cec4b098e28f461c3b63d3c877e65520d70277", + "logs": [ + { + "_type": "log", + "address": "0xE2B06CDBB6128347B11DE676DA8b51e1e1f7F76E", + "blockHash": "0xadc922dddf7b760f4c36633a3e568b82e5b3700d96816b123f713480980fdd8d", + "blockNumber": 21188845, + "data": "0x", + "index": 89, + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000056e44874f624ebde6efcc783efd685f0fbdc6dcf" + ], + "transactionHash": "0xe9aade571e8efacaba118f85e6cec4b098e28f461c3b63d3c877e65520d70277", + "transactionIndex": 88 + } + ], + "blockNumber": 21188845, + "cumulativeGasUsed": "4910550", + "status": 1 + }, + "args": [ + "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF" + ], + "numDeployments": 1, + "bytecode": "0x6080346100b957601f610a6538819003918201601f19168301916001600160401b038311848410176100bd578084926020946040528339810103126100b957516001600160a01b0390818116908190036100b95780156100a1575f80546001600160a01b03198116831782556040519316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a361099390816100d28239f35b604051631e4fbdf760e01b81525f6004820152602490fd5b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe60406080815260049081361015610014575f80fd5b5f3560e01c8063023276f0146105bd5780631471c9221461055657806343654a30146104ef5780634895028514610488578063715018a6146103ee5780638da5cb5b1461039d578063bfef7bdf1461028c578063da40385d146101645763f2fde38b1461007f575f80fd5b346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101605781359173ffffffffffffffffffffffffffffffffffffffff91828416809403610160576100d961090d565b83156101315750505f54827fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b905f60249251917f1e4fbdf7000000000000000000000000000000000000000000000000000000008352820152fd5b5f80fd5b5090346101605761017436610694565b61017c61090d565b5f5b815181101561028a5773ffffffffffffffffffffffffffffffffffffffff90816101a882856108a0565b511691855180937f38d52e0f000000000000000000000000000000000000000000000000000000008252818760209384935afa801561028057826002916001965f91610253575b501691836101fd86896108a0565b51165f5260038152885f20937fffffffffffffffffffffffff000000000000000000000000000000000000000094848682541617905561023d86896108a0565b5116925f5252865f20918254161790550161017e565b6102739150843d8611610279575b61026b8183610626565b8101906108e1565b5f6101ef565b503d610261565b87513d5f823e3d90fd5b005b5034610160579061029c36610694565b916102a561090d565b5f925b805184101561028a5773ffffffffffffffffffffffffffffffffffffffff93846102d282846108a0565b511694835180967f38d52e0f000000000000000000000000000000000000000000000000000000008252818760209384935afa908115610393576001949596975f92610373575b50826002929361032986896108a0565b51165f5260038252875f20937fffffffffffffffffffffffff000000000000000000000000000000000000000094858154169055165f5252845f20908154169055019291906102a8565b6002925061038d90823d84116102795761026b8183610626565b91610319565b85513d5f823e3d90fd5b5034610160575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101605760209073ffffffffffffffffffffffffffffffffffffffff5f54169051908152f35b34610160575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101605761042461090d565b5f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b5090346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261016057359073ffffffffffffffffffffffffffffffffffffffff808316809303610160576020925f5260018352815f2054169051908152f35b5090346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261016057359073ffffffffffffffffffffffffffffffffffffffff808316809303610160576020925f5260038352815f2054169051908152f35b5090346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261016057359073ffffffffffffffffffffffffffffffffffffffff808316809303610160576020925f5260028352815f2054169051908152f35b5090346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610160573573ffffffffffffffffffffffffffffffffffffffff9081811681036101605761061790610752565b90918351921682526020820152f35b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761066757604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101605767ffffffffffffffff916004358381116101605781602382011215610160578060040135938411610667578360051b90604051946107006020840187610626565b85526024602086019282010192831161016057602401905b828210610726575050505090565b813573ffffffffffffffffffffffffffffffffffffffff81168103610160578152908301908301610718565b9073ffffffffffffffffffffffffffffffffffffffff80921691825f5260206003815260409382855f2054169260028352855f2054168315155f1461081e575090806024928651938480927f07a2d13a000000000000000000000000000000000000000000000000000000008252670de0b6b3a764000060048301525afa94851561081557505f946107e5575b50509190565b9080929450813d831161080e575b6107fd8183610626565b810103126101605751915f806107df565b503d6107f3565b513d5f823e3d90fd5b9250508115610877578351907fc6e6f592000000000000000000000000000000000000000000000000000000008252670de0b6b3a764000060048301528082602481865afa94851561081557505f946107e55750509190565b600484517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b80518210156108b45760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b90816020910312610160575173ffffffffffffffffffffffffffffffffffffffff811681036101605790565b73ffffffffffffffffffffffffffffffffffffffff5f5416330361092d57565b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fdfea26469706673582212202d6af06104b044e3eac63a94c2d7e00f99fb716f8d37e328b2fc1368f26e2e6a64736f6c63430008170033", + "deployedBytecode": "0x60406080815260049081361015610014575f80fd5b5f3560e01c8063023276f0146105bd5780631471c9221461055657806343654a30146104ef5780634895028514610488578063715018a6146103ee5780638da5cb5b1461039d578063bfef7bdf1461028c578063da40385d146101645763f2fde38b1461007f575f80fd5b346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101605781359173ffffffffffffffffffffffffffffffffffffffff91828416809403610160576100d961090d565b83156101315750505f54827fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b905f60249251917f1e4fbdf7000000000000000000000000000000000000000000000000000000008352820152fd5b5f80fd5b5090346101605761017436610694565b61017c61090d565b5f5b815181101561028a5773ffffffffffffffffffffffffffffffffffffffff90816101a882856108a0565b511691855180937f38d52e0f000000000000000000000000000000000000000000000000000000008252818760209384935afa801561028057826002916001965f91610253575b501691836101fd86896108a0565b51165f5260038152885f20937fffffffffffffffffffffffff000000000000000000000000000000000000000094848682541617905561023d86896108a0565b5116925f5252865f20918254161790550161017e565b6102739150843d8611610279575b61026b8183610626565b8101906108e1565b5f6101ef565b503d610261565b87513d5f823e3d90fd5b005b5034610160579061029c36610694565b916102a561090d565b5f925b805184101561028a5773ffffffffffffffffffffffffffffffffffffffff93846102d282846108a0565b511694835180967f38d52e0f000000000000000000000000000000000000000000000000000000008252818760209384935afa908115610393576001949596975f92610373575b50826002929361032986896108a0565b51165f5260038252875f20937fffffffffffffffffffffffff000000000000000000000000000000000000000094858154169055165f5252845f20908154169055019291906102a8565b6002925061038d90823d84116102795761026b8183610626565b91610319565b85513d5f823e3d90fd5b5034610160575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101605760209073ffffffffffffffffffffffffffffffffffffffff5f54169051908152f35b34610160575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101605761042461090d565b5f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b5090346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261016057359073ffffffffffffffffffffffffffffffffffffffff808316809303610160576020925f5260018352815f2054169051908152f35b5090346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261016057359073ffffffffffffffffffffffffffffffffffffffff808316809303610160576020925f5260038352815f2054169051908152f35b5090346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261016057359073ffffffffffffffffffffffffffffffffffffffff808316809303610160576020925f5260028352815f2054169051908152f35b5090346101605760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610160573573ffffffffffffffffffffffffffffffffffffffff9081811681036101605761061790610752565b90918351921682526020820152f35b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761066757604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101605767ffffffffffffffff916004358381116101605781602382011215610160578060040135938411610667578360051b90604051946107006020840187610626565b85526024602086019282010192831161016057602401905b828210610726575050505090565b813573ffffffffffffffffffffffffffffffffffffffff81168103610160578152908301908301610718565b9073ffffffffffffffffffffffffffffffffffffffff80921691825f5260206003815260409382855f2054169260028352855f2054168315155f1461081e575090806024928651938480927f07a2d13a000000000000000000000000000000000000000000000000000000008252670de0b6b3a764000060048301525afa94851561081557505f946107e5575b50509190565b9080929450813d831161080e575b6107fd8183610626565b810103126101605751915f806107df565b503d6107f3565b513d5f823e3d90fd5b9250508115610877578351907fc6e6f592000000000000000000000000000000000000000000000000000000008252670de0b6b3a764000060048301528082602481865afa94851561081557505f946107e55750509190565b600484517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b80518210156108b45760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b90816020910312610160575173ffffffffffffffffffffffffffffffffffffffff811681036101605790565b73ffffffffffffffffffffffffffffffffffffffff5f5416330361092d57565b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fdfea26469706673582212202d6af06104b044e3eac63a94c2d7e00f99fb716f8d37e328b2fc1368f26e2e6a64736f6c63430008170033" +} \ No newline at end of file diff --git a/deployments/mainnet/SDaiWrapper.json b/deployments/mainnet/SDaiWrapper.json deleted file mode 100644 index 62ed4303..00000000 --- a/deployments/mainnet/SDaiWrapper.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "address": "0xF07317368A4B061dadB8C8239cbfCfd4808B76ce", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "base", - "type": "address" - }, - { - "internalType": "contract IERC20", - "name": "wBase", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "NotAddedMarket", - "type": "error" - }, - { - "inputs": [], - "name": "NotRemovedMarket", - "type": "error" - }, - { - "inputs": [], - "name": "NotSupportedToken", - "type": "error" - }, - { - "inputs": [], - "name": "BASE", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "WBASE", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "token", - "type": "address" - } - ], - "name": "wrap", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "wrappedToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "rate", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xd3a7d945554bbe9a83d551aa27c1cfd0e80f4664e7c815a60e69123bfbff3a7e", - "receipt": { - "to": null, - "from": "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF", - "contractAddress": "0xF07317368A4B061dadB8C8239cbfCfd4808B76ce", - "transactionIndex": 88, - "gasUsed": "267200", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x855d1d2ee7265ff3ee48da87dde2b7ec0b6660d027cd00fab8cc2ee414693a4c", - "transactionHash": "0xd3a7d945554bbe9a83d551aa27c1cfd0e80f4664e7c815a60e69123bfbff3a7e", - "logs": [], - "blockNumber": 17979064, - "cumulativeGasUsed": "11229888", - "status": 1, - "byzantium": true - }, - "args": [ - "0x6B175474E89094C44Da98b954EedeAC495271d0F", - "0x83F20F44975D03b1b09e64809B757c47f942BEeA" - ], - "numDeployments": 1, - "solcInputHash": "671e1fe85a8879eb40e6f766670e2d1a", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"base\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"wBase\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"NotAddedMarket\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotRemovedMarket\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotSupportedToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BASE\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WBASE\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"wrap\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"wrappedToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rate\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/wrappers/SDaiWrapper.sol\":\"SDaiWrapper\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"contracts/interfaces/ISDai.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\ninterface ISDai {\\n function previewDeposit(uint256 assets) external view returns (uint256);\\n function previewRedeem(uint256 shares) external view returns (uint256);\\n}\\n\\n\",\"keccak256\":\"0x1131eb9ce2feefa1718a21433dcdf3a6867fd1ae29ea3c6d29f6321bf861a2e8\",\"license\":\"MIT\"},\"contracts/interfaces/IWrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IWrapper {\\n error NotSupportedToken();\\n error NotAddedMarket();\\n error NotRemovedMarket();\\n\\n function wrap(IERC20 token) external view returns (IERC20 wrappedToken, uint256 rate);\\n}\\n\",\"keccak256\":\"0xa0deb810fb219935e06d8f3cc47266532c088173d65034a9b0f09909b9d9d454\",\"license\":\"MIT\"},\"contracts/wrappers/SDaiWrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\nimport \\\"../interfaces/ISDai.sol\\\";\\nimport \\\"./Wrapper.sol\\\";\\n\\ncontract SDaiWrapper is Wrapper {\\n constructor(IERC20 base, IERC20 wBase) Wrapper(base, wBase) {} // solhint-disable-line no-empty-blocks\\n\\n function _wrap() internal view override returns (IERC20 wrappedToken, uint256 rate) {\\n return (WBASE, ISDai(address(WBASE)).previewDeposit(1e18));\\n }\\n\\n function _unwrap() internal view override returns (IERC20 unwrappedToken, uint256 rate) {\\n return (BASE, ISDai(address(WBASE)).previewRedeem(1e18));\\n }\\n}\\n\",\"keccak256\":\"0xda446c1d04437e849c17cbdca1bd66a2cb09e7e79a93a3870ce26869563c13e6\",\"license\":\"MIT\"},\"contracts/wrappers/Wrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\nimport \\\"../interfaces/IWrapper.sol\\\";\\n\\nabstract contract Wrapper is IWrapper {\\n IERC20 public immutable BASE;\\n IERC20 public immutable WBASE;\\n\\n constructor(IERC20 base, IERC20 wBase) {\\n BASE = base;\\n WBASE = wBase;\\n }\\n\\n function wrap(IERC20 token) external view override returns (IERC20 wrappedToken, uint256 rate) {\\n if(token == BASE) {\\n return _wrap();\\n } else if (token == WBASE) {\\n return _unwrap();\\n } else {\\n revert NotSupportedToken();\\n }\\n }\\n\\n function _wrap() internal view virtual returns (IERC20 wrappedToken, uint256 rate) {} // solhint-disable-line no-empty-blocks\\n\\n function _unwrap() internal view virtual returns (IERC20 unwrappedToken, uint256 rate) {} // solhint-disable-line no-empty-blocks\\n}\\n\",\"keccak256\":\"0x4529f0f26cbc2e113464c03e2eb0aef444ed988d8626e1487db214323073aaad\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60c03461008d57601f61049938819003918201601f19168301916001600160401b0383118484101761009257808492604094855283398101031261008d57610052602061004b836100a8565b92016100a8565b9060805260a0526040516103dc90816100bd823960805181818160880152610192015260a05181818160fa015281816101dd01526102930152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b038216820361008d5756fe6080604052600436101561001257600080fd5b6000803560e01c8063023276f01461011e5780638e0b3bf2146100af5763ec342ad01461003e57600080fd5b346100ac57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100ac57602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b80fd5b50346100ac57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100ac57602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346100ac5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100ac576004359073ffffffffffffffffffffffffffffffffffffffff9081831683036100ac575061017d60409261018c565b90918351921682526020820152f35b906000917f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff809216828216811460001461028f575050602460207f000000000000000000000000000000000000000000000000000000000000000092604051928380927fef8b30f7000000000000000000000000000000000000000000000000000000008252670de0b6b3a7640000600483015286165afa93841561028357809461024d575b50509190565b909193506020823d821161027b575b8161026960209383610336565b810103126100ac575051913880610247565b3d915061025c565b604051903d90823e3d90fd5b90917f00000000000000000000000000000000000000000000000000000000000000001690810361030c576020602491604051928380927f4cdad506000000000000000000000000000000000000000000000000000000008252670de0b6b3a764000060048301525afa93841561028357809461024d5750509190565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761037757604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea2646970667358221220412685b3fb0c84420ed69237e2b0ed6af5bcd765ddb0318db96d97f2708290c964736f6c63430008130033", - "deployedBytecode": "0x6080604052600436101561001257600080fd5b6000803560e01c8063023276f01461011e5780638e0b3bf2146100af5763ec342ad01461003e57600080fd5b346100ac57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100ac57602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b80fd5b50346100ac57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100ac57602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346100ac5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100ac576004359073ffffffffffffffffffffffffffffffffffffffff9081831683036100ac575061017d60409261018c565b90918351921682526020820152f35b906000917f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff809216828216811460001461028f575050602460207f000000000000000000000000000000000000000000000000000000000000000092604051928380927fef8b30f7000000000000000000000000000000000000000000000000000000008252670de0b6b3a7640000600483015286165afa93841561028357809461024d575b50509190565b909193506020823d821161027b575b8161026960209383610336565b810103126100ac575051913880610247565b3d915061025c565b604051903d90823e3d90fd5b90917f00000000000000000000000000000000000000000000000000000000000000001690810361030c576020602491604051928380927f4cdad506000000000000000000000000000000000000000000000000000000008252670de0b6b3a764000060048301525afa93841561028357809461024d5750509190565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761037757604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea2646970667358221220412685b3fb0c84420ed69237e2b0ed6af5bcd765ddb0318db96d97f2708290c964736f6c63430008130033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/mainnet/SUSDeWrapper.json b/deployments/mainnet/SUSDeWrapper.json deleted file mode 100644 index c3b69846..00000000 --- a/deployments/mainnet/SUSDeWrapper.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "address": "0x6b4A160c09E7acCB2Ceb881E52409a01731d112c", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "base", - "type": "address" - }, - { - "internalType": "contract IERC20", - "name": "wBase", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "NotAddedMarket", - "type": "error" - }, - { - "inputs": [], - "name": "NotRemovedMarket", - "type": "error" - }, - { - "inputs": [], - "name": "NotSupportedToken", - "type": "error" - }, - { - "inputs": [], - "name": "BASE", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "WBASE", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "token", - "type": "address" - } - ], - "name": "wrap", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "wrappedToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "rate", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xb752e2b255c97b3518af8b7d12708b04fdf9b9b66d8602dc9fbc44445d2ef17a", - "receipt": { - "to": null, - "from": "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF", - "contractAddress": "0x6b4A160c09E7acCB2Ceb881E52409a01731d112c", - "transactionIndex": 21, - "gasUsed": "262302", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x43b7d103d6f5d071437e33f54775cd1110a60d31e01dfe02c55e2327d84c53eb", - "transactionHash": "0xb752e2b255c97b3518af8b7d12708b04fdf9b9b66d8602dc9fbc44445d2ef17a", - "logs": [], - "blockNumber": 20212526, - "cumulativeGasUsed": "4733802", - "status": 1, - "byzantium": true - }, - "args": [ - "0x4c9EDD5852cd905f086C759E8383e09bff1E68B3", - "0x9D39A5DE30e57443BfF2A8307A4256c8797A3497" - ], - "numDeployments": 1, - "solcInputHash": "e4827d5fa0d141df751971a4120a027f", - "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"base\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"wBase\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"NotAddedMarket\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotRemovedMarket\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotSupportedToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BASE\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WBASE\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"wrap\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"wrappedToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rate\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/wrappers/SUSDeWrapper.sol\":\"SUSDeWrapper\"},\"evmVersion\":\"shanghai\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/interfaces/IERC4626.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC4626.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../token/ERC20/IERC20.sol\\\";\\nimport {IERC20Metadata} from \\\"../token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\n/**\\n * @dev Interface of the ERC4626 \\\"Tokenized Vault Standard\\\", as defined in\\n * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].\\n */\\ninterface IERC4626 is IERC20, IERC20Metadata {\\n event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);\\n\\n event Withdraw(\\n address indexed sender,\\n address indexed receiver,\\n address indexed owner,\\n uint256 assets,\\n uint256 shares\\n );\\n\\n /**\\n * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.\\n *\\n * - MUST be an ERC-20 token contract.\\n * - MUST NOT revert.\\n */\\n function asset() external view returns (address assetTokenAddress);\\n\\n /**\\n * @dev Returns the total amount of the underlying asset that is \\u201cmanaged\\u201d by Vault.\\n *\\n * - SHOULD include any compounding that occurs from yield.\\n * - MUST be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT revert.\\n */\\n function totalAssets() external view returns (uint256 totalManagedAssets);\\n\\n /**\\n * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal\\n * scenario where all the conditions are met.\\n *\\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT show any variations depending on the caller.\\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\\n * - MUST NOT revert.\\n *\\n * NOTE: This calculation MAY NOT reflect the \\u201cper-user\\u201d price-per-share, and instead should reflect the\\n * \\u201caverage-user\\u2019s\\u201d price-per-share, meaning what the average user should expect to see when exchanging to and\\n * from.\\n */\\n function convertToShares(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal\\n * scenario where all the conditions are met.\\n *\\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT show any variations depending on the caller.\\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\\n * - MUST NOT revert.\\n *\\n * NOTE: This calculation MAY NOT reflect the \\u201cper-user\\u201d price-per-share, and instead should reflect the\\n * \\u201caverage-user\\u2019s\\u201d price-per-share, meaning what the average user should expect to see when exchanging to and\\n * from.\\n */\\n function convertToAssets(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,\\n * through a deposit call.\\n *\\n * - MUST return a limited value if receiver is subject to some deposit limit.\\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.\\n * - MUST NOT revert.\\n */\\n function maxDeposit(address receiver) external view returns (uint256 maxAssets);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given\\n * current on-chain conditions.\\n *\\n * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit\\n * call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called\\n * in the same transaction.\\n * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the\\n * deposit would be accepted, regardless if the user has enough tokens approved, etc.\\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\\n */\\n function previewDeposit(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.\\n *\\n * - MUST emit the Deposit event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * deposit execution, and are accounted for during deposit.\\n * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not\\n * approving enough underlying tokens to the Vault contract, etc).\\n *\\n * NOTE: most implementations will require pre-approval of the Vault with the Vault\\u2019s underlying asset token.\\n */\\n function deposit(uint256 assets, address receiver) external returns (uint256 shares);\\n\\n /**\\n * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.\\n * - MUST return a limited value if receiver is subject to some mint limit.\\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.\\n * - MUST NOT revert.\\n */\\n function maxMint(address receiver) external view returns (uint256 maxShares);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given\\n * current on-chain conditions.\\n *\\n * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call\\n * in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the\\n * same transaction.\\n * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint\\n * would be accepted, regardless if the user has enough tokens approved, etc.\\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by minting.\\n */\\n function previewMint(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.\\n *\\n * - MUST emit the Deposit event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint\\n * execution, and are accounted for during mint.\\n * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not\\n * approving enough underlying tokens to the Vault contract, etc).\\n *\\n * NOTE: most implementations will require pre-approval of the Vault with the Vault\\u2019s underlying asset token.\\n */\\n function mint(uint256 shares, address receiver) external returns (uint256 assets);\\n\\n /**\\n * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the\\n * Vault, through a withdraw call.\\n *\\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\\n * - MUST NOT revert.\\n */\\n function maxWithdraw(address owner) external view returns (uint256 maxAssets);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,\\n * given current on-chain conditions.\\n *\\n * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw\\n * call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if\\n * called\\n * in the same transaction.\\n * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though\\n * the withdrawal would be accepted, regardless if the user has enough shares, etc.\\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\\n */\\n function previewWithdraw(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.\\n *\\n * - MUST emit the Withdraw event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * withdraw execution, and are accounted for during withdraw.\\n * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner\\n * not having enough shares, etc).\\n *\\n * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\\n * Those methods should be performed separately.\\n */\\n function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);\\n\\n /**\\n * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,\\n * through a redeem call.\\n *\\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\\n * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.\\n * - MUST NOT revert.\\n */\\n function maxRedeem(address owner) external view returns (uint256 maxShares);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,\\n * given current on-chain conditions.\\n *\\n * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call\\n * in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the\\n * same transaction.\\n * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the\\n * redemption would be accepted, regardless if the user has enough shares, etc.\\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by redeeming.\\n */\\n function previewRedeem(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.\\n *\\n * - MUST emit the Withdraw event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * redeem execution, and are accounted for during redeem.\\n * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner\\n * not having enough shares, etc).\\n *\\n * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\\n * Those methods should be performed separately.\\n */\\n function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);\\n}\\n\",\"keccak256\":\"0x207f64371bc0fcc5be86713aa5da109a870cc3a6da50e93b64ee881e369b593d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xc6a8ff0ea489379b61faa647490411b80102578440ab9d84e9a957cc12164e70\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0xaa761817f6cd7892fcf158b3c776b34551cde36f48ff9703d53898bc45a94ea2\",\"license\":\"MIT\"},\"contracts/interfaces/IWrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IWrapper {\\n error NotSupportedToken();\\n error NotAddedMarket();\\n error NotRemovedMarket();\\n\\n function wrap(IERC20 token) external view returns (IERC20 wrappedToken, uint256 rate);\\n}\\n\",\"keccak256\":\"0x1d3cefe7c67b9f9750823be723dd0b00f9894ec4e0cd078eac321a2cff8f7da2\",\"license\":\"MIT\"},\"contracts/wrappers/SUSDeWrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport \\\"./Wrapper.sol\\\";\\nimport \\\"@openzeppelin/contracts/interfaces/IERC4626.sol\\\";\\n\\ncontract SUSDeWrapper is Wrapper {\\n\\n constructor(IERC20 base, IERC20 wBase) Wrapper(base, wBase) {} // solhint-disable-line no-empty-blocks\\n\\n function _wrap() internal view virtual override returns (IERC20 wrappedToken, uint256 rate) {\\n return (WBASE, IERC4626(address(WBASE)).convertToShares(1e18)); // scale down when minting sUSDe with USDe\\n }\\n\\n function _unwrap() internal view virtual override returns (IERC20 unwrappedToken, uint256 rate) {\\n return (BASE, IERC4626(address(WBASE)).convertToAssets(1e18)); // scale up when redeeming sUSDe for USDe\\n }\\n}\\n\",\"keccak256\":\"0xeb1e31e4f07bd7de0b6adb7706b46d218947232d6125627e38a0e98343f29570\",\"license\":\"MIT\"},\"contracts/wrappers/Wrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport \\\"../interfaces/IWrapper.sol\\\";\\n\\nabstract contract Wrapper is IWrapper {\\n IERC20 public immutable BASE;\\n IERC20 public immutable WBASE;\\n\\n constructor(IERC20 base, IERC20 wBase) {\\n BASE = base;\\n WBASE = wBase;\\n }\\n\\n function wrap(IERC20 token) external view override returns (IERC20 wrappedToken, uint256 rate) {\\n if(token == BASE) {\\n return _wrap();\\n } else if (token == WBASE) {\\n return _unwrap();\\n } else {\\n revert NotSupportedToken();\\n }\\n }\\n\\n function _wrap() internal view virtual returns (IERC20 wrappedToken, uint256 rate) {} // solhint-disable-line no-empty-blocks\\n\\n function _unwrap() internal view virtual returns (IERC20 unwrappedToken, uint256 rate) {} // solhint-disable-line no-empty-blocks\\n}\\n\",\"keccak256\":\"0xfcd599a5fd47efb91353766756707072756da2f2682f6e54b2ae525a71fc1ffb\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60c03461008d57601f61047f38819003918201601f19168301916001600160401b0383118484101761009157808492604094855283398101031261008d57610052602061004b836100a5565b92016100a5565b9060805260a0526040516103c590816100ba8239608051818181608401526101a0015260a05181818160f6015281816101d1015261027d0152f35b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b038216820361008d5756fe60806040526004361015610011575f80fd5b5f3560e01c8063023276f01461011a5780638e0b3bf2146100ac5763ec342ad01461003a575f80fd5b346100a8575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a857602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5f80fd5b346100a8575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a857602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b346100a85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a85760043573ffffffffffffffffffffffffffffffffffffffff80821682036100a857610175604092610184565b90918351921682526020820152f35b73ffffffffffffffffffffffffffffffffffffffff90811691907f0000000000000000000000000000000000000000000000000000000000000000818116840361027a57506024925060207f000000000000000000000000000000000000000000000000000000000000000091604051948580927fc6e6f592000000000000000000000000000000000000000000000000000000008252670de0b6b3a7640000600483015285165afa92831561026f575f9361023f57509190565b9092506020813d602011610267575b8161025b60209383610321565b810103126100a8575190565b3d915061024e565b6040513d5f823e3d90fd5b907f0000000000000000000000000000000000000000000000000000000000000000168093145f146102f7576020602493604051948580927f07a2d13a000000000000000000000000000000000000000000000000000000008252670de0b6b3a764000060048301525afa92831561026f575f9361023f57509190565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761036257604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffdfea26469706673582212202cf246c09d0b6e7fcba77a553df7c3792424a3170bb347b67ef3c04efdf533af64736f6c63430008170033", - "deployedBytecode": "0x60806040526004361015610011575f80fd5b5f3560e01c8063023276f01461011a5780638e0b3bf2146100ac5763ec342ad01461003a575f80fd5b346100a8575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a857602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5f80fd5b346100a8575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a857602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b346100a85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a85760043573ffffffffffffffffffffffffffffffffffffffff80821682036100a857610175604092610184565b90918351921682526020820152f35b73ffffffffffffffffffffffffffffffffffffffff90811691907f0000000000000000000000000000000000000000000000000000000000000000818116840361027a57506024925060207f000000000000000000000000000000000000000000000000000000000000000091604051948580927fc6e6f592000000000000000000000000000000000000000000000000000000008252670de0b6b3a7640000600483015285165afa92831561026f575f9361023f57509190565b9092506020813d602011610267575b8161025b60209383610321565b810103126100a8575190565b3d915061024e565b6040513d5f823e3d90fd5b907f0000000000000000000000000000000000000000000000000000000000000000168093145f146102f7576020602493604051948580927f07a2d13a000000000000000000000000000000000000000000000000000000008252670de0b6b3a764000060048301525afa92831561026f575f9361023f57509190565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761036257604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffdfea26469706673582212202cf246c09d0b6e7fcba77a553df7c3792424a3170bb347b67ef3c04efdf533af64736f6c63430008170033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/docs/wrappers/Erc4626Wrapper.md b/docs/wrappers/Erc4626Wrapper.md new file mode 100644 index 00000000..2056dcd6 --- /dev/null +++ b/docs/wrappers/Erc4626Wrapper.md @@ -0,0 +1,34 @@ + +## Erc4626Wrapper + +### Functions list +- [constructor(_owner) public](#constructor) +- [addMarkets(tokens) external](#addmarkets) +- [removeMarkets(tokens) external](#removemarkets) +- [wrap(token) external](#wrap) + +### Functions +### constructor + +```solidity +constructor(address _owner) public +``` + +### addMarkets + +```solidity +function addMarkets(address[] tokens) external +``` + +### removeMarkets + +```solidity +function removeMarkets(address[] tokens) external +``` + +### wrap + +```solidity +function wrap(contract IERC20 token) external view returns (contract IERC20 wrappedToken, uint256 rate) +``` + diff --git a/test/oracles/SolidlyOracle.js b/test/oracles/SolidlyOracle.js index 9c1c1c14..17f32bfe 100644 --- a/test/oracles/SolidlyOracle.js +++ b/test/oracles/SolidlyOracle.js @@ -35,25 +35,25 @@ describe('SolidlyOracle', function () { return { oracle, uniswapV3Oracle }; } - function shouldWorkForOracle (fixture) { + function shouldWorkForOracle (fixture, relativeDiff = 0.05) { it('WETH -> axlUSDC', async function () { const { oracle, uniswapV3Oracle } = await loadFixture(fixture); - await testRate(tokens.base.WETH, tokens.base.axlUSDC, tokens.NONE, oracle, uniswapV3Oracle, 0.1); + await testRate(tokens.base.WETH, tokens.base.axlUSDC, tokens.NONE, oracle, uniswapV3Oracle, relativeDiff); }); it('axlUSDC -> WETH', async function () { const { oracle, uniswapV3Oracle } = await loadFixture(fixture); - await testRate(tokens.base.axlUSDC, tokens.base.WETH, tokens.NONE, oracle, uniswapV3Oracle, 0.1); + await testRate(tokens.base.axlUSDC, tokens.base.WETH, tokens.NONE, oracle, uniswapV3Oracle, relativeDiff); }); it('WETH -> DAI', async function () { const { oracle, uniswapV3Oracle } = await loadFixture(fixture); - await testRate(tokens.base.WETH, tokens.base.DAI, tokens.NONE, oracle, uniswapV3Oracle, 0.1); + await testRate(tokens.base.WETH, tokens.base.DAI, tokens.NONE, oracle, uniswapV3Oracle, relativeDiff); }); it('DAI -> WETH', async function () { const { oracle, uniswapV3Oracle } = await loadFixture(fixture); - await testRate(tokens.base.DAI, tokens.base.WETH, tokens.NONE, oracle, uniswapV3Oracle, 0.1); + await testRate(tokens.base.DAI, tokens.base.WETH, tokens.NONE, oracle, uniswapV3Oracle, relativeDiff); }); it('rETH -> WETH', async function () { @@ -62,7 +62,7 @@ describe('SolidlyOracle', function () { if (await oracle.FACTORY() !== Aerodrome.factory) { this.skip(); } - await testRate(tokens.base.rETH, tokens.base.WETH, tokens.NONE, oracle, uniswapV3Oracle, 0.1); + await testRate(tokens.base.rETH, tokens.base.WETH, tokens.NONE, oracle, uniswapV3Oracle, relativeDiff); }); it('WETH -> rETH', async function () { @@ -71,7 +71,7 @@ describe('SolidlyOracle', function () { if (await oracle.FACTORY() !== Aerodrome.factory) { this.skip(); } - await testRate(tokens.base.WETH, tokens.base.rETH, tokens.NONE, oracle, uniswapV3Oracle, 0.1); + await testRate(tokens.base.WETH, tokens.base.rETH, tokens.NONE, oracle, uniswapV3Oracle, relativeDiff); }); } @@ -80,7 +80,7 @@ describe('SolidlyOracle', function () { }); describe('Aerodrome', function () { - shouldWorkForOracle(deployAerodrome); + shouldWorkForOracle(deployAerodrome, 0.11); }); }); }); diff --git a/test/wrappers/SDaiWrapper.js b/test/wrappers/SDaiWrapper.js deleted file mode 100644 index 388f7e53..00000000 --- a/test/wrappers/SDaiWrapper.js +++ /dev/null @@ -1,26 +0,0 @@ -const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); -const { ethers } = require('hardhat'); -const { expect, ether, deployContract } = require('@1inch/solidity-utils'); -const { tokens } = require('../helpers.js'); - -describe('SDaiWrapper', function () { - async function initContracts () { - const sDaiWrapper = await deployContract('SDaiWrapper', [tokens.DAI, tokens.sDAI]); - const sDai = await ethers.getContractAt('ISDai', tokens.sDAI); - return { sDaiWrapper, sDai }; - } - - it('DAI -> sDAI', async function () { - const { sDaiWrapper, sDai } = await loadFixture(initContracts); - const response = await sDaiWrapper.wrap(tokens.DAI); - expect(response.rate).to.equal(await sDai.previewDeposit(ether('1'))); - expect(response.wrappedToken).to.equal(tokens.sDAI); - }); - - it('sDAI -> DAI', async function () { - const { sDaiWrapper, sDai } = await loadFixture(initContracts); - const response = await sDaiWrapper.wrap(tokens.sDAI); - expect(response.rate).to.equal(await sDai.previewRedeem(ether('1'))); - expect(response.wrappedToken).to.equal(tokens.DAI); - }); -}); diff --git a/test/wrappers/SUSDeWrapper.js b/test/wrappers/SUSDeWrapper.js deleted file mode 100644 index 1341e276..00000000 --- a/test/wrappers/SUSDeWrapper.js +++ /dev/null @@ -1,26 +0,0 @@ -const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); -const { ethers } = require('hardhat'); -const { expect, ether, deployContract } = require('@1inch/solidity-utils'); -const { tokens } = require('../helpers.js'); - -describe('SUSDeWrapper', function () { - async function initContracts () { - const sUSDeWrapper = await deployContract('SUSDeWrapper', [tokens.USDe, tokens.sUSDe]); - const sUSDe = await ethers.getContractAt('IERC4626', tokens.sUSDe); - return { sUSDeWrapper, sUSDe }; - } - - it('USDe -> sUSDe', async function () { - const { sUSDeWrapper, sUSDe } = await loadFixture(initContracts); - const response = await sUSDeWrapper.wrap(tokens.USDe); - expect(response.rate).to.equal(await sUSDe.convertToShares(ether('1'))); - expect(response.wrappedToken).to.equal(tokens.sUSDe); - }); - - it('sUSDe -> USDe', async function () { - const { sUSDeWrapper, sUSDe } = await loadFixture(initContracts); - const response = await sUSDeWrapper.wrap(tokens.sUSDe); - expect(response.rate).to.equal(await sUSDe.convertToAssets(ether('1'))); - expect(response.wrappedToken).to.equal(tokens.USDe); - }); -}); diff --git a/test/wrappers/WsuperOETHbWrapper.js b/test/wrappers/WsuperOETHbWrapper.js deleted file mode 100644 index 180b91f4..00000000 --- a/test/wrappers/WsuperOETHbWrapper.js +++ /dev/null @@ -1,35 +0,0 @@ -const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); -const { ethers, network } = require('hardhat'); -const { expect, ether, deployContract } = require('@1inch/solidity-utils'); -const { resetHardhatNetworkFork } = require('@1inch/solidity-utils/hardhat-setup'); -const { tokens } = require('../helpers.js'); - -describe('WsuperOETHbWrapper', function () { - before(async function () { - await resetHardhatNetworkFork(network, 'base'); - }); - - after(async function () { - await resetHardhatNetworkFork(network, 'mainnet'); - }); - - async function initContracts () { - const wsuperOETHbWrapper = await deployContract('WsuperOETHbWrapper', [tokens.base.superOETHb, tokens.base.wsuperOETHb]); - const wsuperOETHb = await ethers.getContractAt('ISDai', tokens.base.wsuperOETHb); - return { wsuperOETHbWrapper, wsuperOETHb }; - } - - it('superOETHb -> wsuperOETHb', async function () { - const { wsuperOETHbWrapper, wsuperOETHb } = await loadFixture(initContracts); - const response = await wsuperOETHbWrapper.wrap(tokens.base.superOETHb); - expect(response.rate).to.equal(await wsuperOETHb.previewDeposit(ether('1'))); - expect(response.wrappedToken).to.equal(tokens.base.wsuperOETHb); - }); - - it('wsuperOETHb -> superOETHb', async function () { - const { wsuperOETHbWrapper, wsuperOETHb } = await loadFixture(initContracts); - const response = await wsuperOETHbWrapper.wrap(tokens.base.wsuperOETHb); - expect(response.rate).to.equal(await wsuperOETHb.previewRedeem(ether('1'))); - expect(response.wrappedToken).to.equal(tokens.base.superOETHb); - }); -});