-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #198 from 1inch/deploy/add-usds-wrapper
[SC-1313] Add USDS wrapper
- Loading branch information
Showing
2 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
{ | ||
"address": "0x18645943628cf0FdCD1A9FF3a5b56d71203CFc22", | ||
"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": "0x285f97d66a073ccd389f2b342a431eb6d76e184e15bad8d7be6b7687cd781d9e", | ||
"receipt": { | ||
"to": null, | ||
"from": "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF", | ||
"contractAddress": "0x18645943628cf0FdCD1A9FF3a5b56d71203CFc22", | ||
"transactionIndex": 22, | ||
"gasUsed": "195851", | ||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", | ||
"blockHash": "0x6e3032a5f58670465dacf2ad2993bcd21ddb23624e2923dede604929218fa863", | ||
"transactionHash": "0x285f97d66a073ccd389f2b342a431eb6d76e184e15bad8d7be6b7687cd781d9e", | ||
"logs": [], | ||
"blockNumber": 21243724, | ||
"cumulativeGasUsed": "4866960", | ||
"status": 1, | ||
"byzantium": true | ||
}, | ||
"args": [ | ||
"0x6B175474E89094C44Da98b954EedeAC495271d0F", | ||
"0xdC035D45d973E3EC169d2276DDab16f1e407384F" | ||
], | ||
"numDeployments": 1, | ||
"solcInputHash": "8040a3e71109d305ac56c5e7ce078c26", | ||
"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/BaseCoinWrapper.sol\":\"BaseCoinWrapper\"},\"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.1.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-20 standard as defined in the ERC.\\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\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"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/BaseCoinWrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport \\\"./Wrapper.sol\\\";\\n\\ncontract BaseCoinWrapper is Wrapper {\\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, 1e18);\\n }\\n\\n function _unwrap() internal view virtual override returns (IERC20 unwrappedToken, uint256 rate) {\\n return (BASE, 1e18);\\n }\\n}\\n\",\"keccak256\":\"0x14ed8197ec69f43f64245d3a1dfabf7e1ff61456e037cf3dc934ed5c31c21fc8\",\"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": "0x60c03461008d57601f61034738819003918201601f19168301916001600160401b0383118484101761009157808492604094855283398101031261008d57610052602061004b836100a5565b92016100a5565b9060805260a05260405161028d90816100ba823960805181818160840152610186015260a05181818160f6015281816101cd01526101fb0152f35b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b038216820361008d5756fe60806040526004361015610011575f80fd5b5f3560e01c8063023276f01461011a5780638e0b3bf2146100ac5763ec342ad01461003a575f80fd5b346100a8575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a857602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5f80fd5b346100a8575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a857602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b346100a85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a85760043573ffffffffffffffffffffffffffffffffffffffff80821682036100a857610175604092610184565b90918351921682526020820152f35b7f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff9081169080831682036101f9575050507f000000000000000000000000000000000000000000000000000000000000000090670de0b6b3a764000090565b7f0000000000000000000000000000000000000000000000000000000000000000160361022d5790670de0b6b3a764000090565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fdfea2646970667358221220c965bd0e385da8a57bda1f0d846db9d146caf2dc9272b7d79f224933b0d6a4df64736f6c63430008170033", | ||
"deployedBytecode": "0x60806040526004361015610011575f80fd5b5f3560e01c8063023276f01461011a5780638e0b3bf2146100ac5763ec342ad01461003a575f80fd5b346100a8575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a857602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5f80fd5b346100a8575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a857602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b346100a85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a85760043573ffffffffffffffffffffffffffffffffffffffff80821682036100a857610175604092610184565b90918351921682526020820152f35b7f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff9081169080831682036101f9575050507f000000000000000000000000000000000000000000000000000000000000000090670de0b6b3a764000090565b7f0000000000000000000000000000000000000000000000000000000000000000160361022d5790670de0b6b3a764000090565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fdfea2646970667358221220c965bd0e385da8a57bda1f0d846db9d146caf2dc9272b7d79f224933b0d6a4df64736f6c63430008170033", | ||
"devdoc": { | ||
"kind": "dev", | ||
"methods": {}, | ||
"version": 1 | ||
}, | ||
"userdoc": { | ||
"kind": "user", | ||
"methods": {}, | ||
"version": 1 | ||
}, | ||
"storageLayout": { | ||
"storage": [], | ||
"types": null | ||
} | ||
} |