From 589ed82a06855b4c5baa3c217c5938baa51d7a0f Mon Sep 17 00:00:00 2001 From: Denis Date: Mon, 11 Mar 2024 22:46:31 +0000 Subject: [PATCH 1/7] Add CompoundV3 as BaseWrapper + tests --- hardhat.config.js | 1 + test/helpers.js | 1 + test/wrappers/BaseCoinWrapper.js | 42 +++++++++++++++++++++++++++++++- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/hardhat.config.js b/hardhat.config.js index 1ee853f4..cf23ac76 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -45,6 +45,7 @@ module.exports = { dependencyCompiler: { paths: [ '@1inch/solidity-utils/contracts/interfaces/ICreate3Deployer.sol', + '@1inch/solidity-utils/contracts/interfaces/IWETH.sol', ], }, zksolc: { diff --git a/test/helpers.js b/test/helpers.js index 640f1594..3422fe5d 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -40,6 +40,7 @@ const tokens = { aWETHV3: '0x4d5F47FA6A74757f35C14fD3a6Ef8E3C9BC514E8', cDAI: '0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643', cETH: '0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5', + cWETHv3: '0xA17581A9E3356d9A858b789D68B4d866e593aE94', iETH: '0xB983E01458529665007fF7E0CDdeCDB74B967Eb6', iDAI: '0x6b093998D36f2C7F0cc359441FBB24CC629D5FF0', iUSDC: '0xF013406A0B1d544238083DF0B93ad0d2cBE0f65f', diff --git a/test/wrappers/BaseCoinWrapper.js b/test/wrappers/BaseCoinWrapper.js index 79e23029..da97f8ef 100644 --- a/test/wrappers/BaseCoinWrapper.js +++ b/test/wrappers/BaseCoinWrapper.js @@ -1,5 +1,7 @@ +const hre = require('hardhat'); +const { ethers } = hre; const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); -const { expect, ether, deployContract } = require('@1inch/solidity-utils'); +const { expect, ether, deployContract, trackReceivedTokenAndTx, assertRoughlyEqualValues } = require('@1inch/solidity-utils'); const { tokens } = require('../helpers.js'); describe('BaseCoinWrapper', function () { @@ -22,3 +24,41 @@ describe('BaseCoinWrapper', function () { expect(response.wrappedToken).to.equal(tokens.ETH); }); }); + +describe('CompoundV3Wrapper', function () { + const COMETABI = [ + 'function supply(address asset, uint amount) external', + 'function withdraw(address asset, uint amount) external', + ]; + + async function initContracts () { + const [wallet] = await ethers.getSigners(); + const baseCoinWrapper = await deployContract('BaseCoinWrapper', [tokens.WETH, tokens.cWETHv3]); + + const IERC20ABI = (await hre.artifacts.readArtifact('IERC20')).abi; + const cWETHv3 = new ethers.Contract(tokens.cWETHv3, [...IERC20ABI, ...COMETABI], wallet); + const weth = await ethers.getContractAt('IWETH', tokens.WETH); + + await weth.deposit({ value: ether('2') }); + await weth.approve(cWETHv3, ether('2')); + + return { wallet, baseCoinWrapper, weth, cWETHv3 }; + } + + it('WETH -> cWETHv3', async function () { + const { wallet, baseCoinWrapper, cWETHv3 } = await loadFixture(initContracts); + const response = await baseCoinWrapper.wrap(tokens.WETH); + const [received] = await trackReceivedTokenAndTx(ethers.provider, cWETHv3, wallet.address, async () => cWETHv3.supply(tokens.WETH, ether('1'))); + expect(response.wrappedToken).to.equal(tokens.cWETHv3); + assertRoughlyEqualValues(response.rate, received, 1e-17); + }); + + it('cWETHv3 -> WETH', async function () { + const { wallet, baseCoinWrapper, weth, cWETHv3 } = await loadFixture(initContracts); + await cWETHv3.supply(tokens.WETH, ether('2')); + const response = await baseCoinWrapper.wrap(tokens.cWETHv3); + const [received] = await trackReceivedTokenAndTx(ethers.provider, weth, wallet.address, async () => cWETHv3.withdraw(tokens.WETH, ether('1'))); + expect(response.wrappedToken).to.equal(tokens.WETH); + assertRoughlyEqualValues(response.rate, received, 1e-17); + }); +}); From 102b795a45f046b860f686a7d19b088d98457029 Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 12 Mar 2024 14:08:41 +0000 Subject: [PATCH 2/7] Add CompoundV3 as separate wrapper + tests --- contracts/interfaces/IComet.sol | 10 ++++ contracts/wrappers/CompoundV3Wrapper.sol | 38 +++++++++++++++ test/helpers.js | 1 + test/wrappers/BaseCoinWrapper.js | 42 +---------------- test/wrappers/CompoundV3Wrapper.js | 60 ++++++++++++++++++++++++ 5 files changed, 110 insertions(+), 41 deletions(-) create mode 100644 contracts/interfaces/IComet.sol create mode 100644 contracts/wrappers/CompoundV3Wrapper.sol create mode 100644 test/wrappers/CompoundV3Wrapper.js diff --git a/contracts/interfaces/IComet.sol b/contracts/interfaces/IComet.sol new file mode 100644 index 00000000..b8051eb2 --- /dev/null +++ b/contracts/interfaces/IComet.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT + +pragma solidity 0.8.23; + +// CompoundV3 money market interface +interface IComet { + function baseToken() external view returns (address); + function supply(address asset, uint amount) external; + function withdraw(address asset, uint amount) external; +} diff --git a/contracts/wrappers/CompoundV3Wrapper.sol b/contracts/wrappers/CompoundV3Wrapper.sol new file mode 100644 index 00000000..2a5a400c --- /dev/null +++ b/contracts/wrappers/CompoundV3Wrapper.sol @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: MIT + +pragma solidity 0.8.23; + +import "../interfaces/IWrapper.sol"; +import "../interfaces/IComet.sol"; +import "@openzeppelin/contracts/access/Ownable.sol"; + +contract CompoundV3Wrapper is IWrapper, Ownable { + mapping(IERC20 => IERC20) public cTokenToToken; + mapping(IERC20 => IERC20) public tokenTocToken; + + constructor(address _owner) Ownable(_owner) {} // solhint-disable-line no-empty-blocks + + function addToken(address token) external onlyOwner { + IERC20 baseToken = IERC20(IComet(token).baseToken()); + cTokenToToken[IERC20(token)] = baseToken; + tokenTocToken[baseToken] = IERC20(token); + } + + function removeToken(address token) external onlyOwner { + IERC20 baseToken = IERC20(IComet(token).baseToken()); + delete cTokenToToken[IERC20(token)]; + delete tokenTocToken[baseToken]; + } + + function wrap(IERC20 token) external view override returns (IERC20 wrappedToken, uint256 rate) { + IERC20 baseToken = cTokenToToken[token]; + IERC20 cToken = tokenTocToken[token]; + if (baseToken != IERC20(address(0))) { + return (baseToken, 1e18); + } else if (cToken != IERC20(address(0))) { + return (cToken, 1e18); + } else { + revert NotSupportedToken(); + } + } +} diff --git a/test/helpers.js b/test/helpers.js index 3422fe5d..30266800 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -40,6 +40,7 @@ const tokens = { aWETHV3: '0x4d5F47FA6A74757f35C14fD3a6Ef8E3C9BC514E8', cDAI: '0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643', cETH: '0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5', + cUSDCv3: '0xc3d688B66703497DAA19211EEdff47f25384cdc3', cWETHv3: '0xA17581A9E3356d9A858b789D68B4d866e593aE94', iETH: '0xB983E01458529665007fF7E0CDdeCDB74B967Eb6', iDAI: '0x6b093998D36f2C7F0cc359441FBB24CC629D5FF0', diff --git a/test/wrappers/BaseCoinWrapper.js b/test/wrappers/BaseCoinWrapper.js index da97f8ef..79e23029 100644 --- a/test/wrappers/BaseCoinWrapper.js +++ b/test/wrappers/BaseCoinWrapper.js @@ -1,7 +1,5 @@ -const hre = require('hardhat'); -const { ethers } = hre; const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); -const { expect, ether, deployContract, trackReceivedTokenAndTx, assertRoughlyEqualValues } = require('@1inch/solidity-utils'); +const { expect, ether, deployContract } = require('@1inch/solidity-utils'); const { tokens } = require('../helpers.js'); describe('BaseCoinWrapper', function () { @@ -24,41 +22,3 @@ describe('BaseCoinWrapper', function () { expect(response.wrappedToken).to.equal(tokens.ETH); }); }); - -describe('CompoundV3Wrapper', function () { - const COMETABI = [ - 'function supply(address asset, uint amount) external', - 'function withdraw(address asset, uint amount) external', - ]; - - async function initContracts () { - const [wallet] = await ethers.getSigners(); - const baseCoinWrapper = await deployContract('BaseCoinWrapper', [tokens.WETH, tokens.cWETHv3]); - - const IERC20ABI = (await hre.artifacts.readArtifact('IERC20')).abi; - const cWETHv3 = new ethers.Contract(tokens.cWETHv3, [...IERC20ABI, ...COMETABI], wallet); - const weth = await ethers.getContractAt('IWETH', tokens.WETH); - - await weth.deposit({ value: ether('2') }); - await weth.approve(cWETHv3, ether('2')); - - return { wallet, baseCoinWrapper, weth, cWETHv3 }; - } - - it('WETH -> cWETHv3', async function () { - const { wallet, baseCoinWrapper, cWETHv3 } = await loadFixture(initContracts); - const response = await baseCoinWrapper.wrap(tokens.WETH); - const [received] = await trackReceivedTokenAndTx(ethers.provider, cWETHv3, wallet.address, async () => cWETHv3.supply(tokens.WETH, ether('1'))); - expect(response.wrappedToken).to.equal(tokens.cWETHv3); - assertRoughlyEqualValues(response.rate, received, 1e-17); - }); - - it('cWETHv3 -> WETH', async function () { - const { wallet, baseCoinWrapper, weth, cWETHv3 } = await loadFixture(initContracts); - await cWETHv3.supply(tokens.WETH, ether('2')); - const response = await baseCoinWrapper.wrap(tokens.cWETHv3); - const [received] = await trackReceivedTokenAndTx(ethers.provider, weth, wallet.address, async () => cWETHv3.withdraw(tokens.WETH, ether('1'))); - expect(response.wrappedToken).to.equal(tokens.WETH); - assertRoughlyEqualValues(response.rate, received, 1e-17); - }); -}); diff --git a/test/wrappers/CompoundV3Wrapper.js b/test/wrappers/CompoundV3Wrapper.js new file mode 100644 index 00000000..161af33e --- /dev/null +++ b/test/wrappers/CompoundV3Wrapper.js @@ -0,0 +1,60 @@ +const hre = require('hardhat'); +const { ethers } = hre; +const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers'); +const { expect, ether, deployContract, trackReceivedTokenAndTx, assertRoughlyEqualValues, constants } = require('@1inch/solidity-utils'); +const { tokens } = require('../helpers.js'); + +describe('CompoundV3Wrapper', function () { + async function initContracts () { + const [wallet, nonOwner] = await ethers.getSigners(); + const compoundV3Wrapper = await deployContract('CompoundV3Wrapper', [wallet]); + + const IERC20ABI = (await hre.artifacts.readArtifact('IERC20')).abi; + const COMETABI = (await hre.artifacts.readArtifact('IComet')).abi; + const cWETHv3 = new ethers.Contract(tokens.cWETHv3, [...IERC20ABI, ...COMETABI], wallet); + const weth = await ethers.getContractAt('IWETH', tokens.WETH); + + await compoundV3Wrapper.addToken(tokens.cWETHv3); + await weth.deposit({ value: ether('2') }); + await weth.approve(cWETHv3, ether('2')); + + return { wallet, nonOwner, compoundV3Wrapper, weth, cWETHv3 }; + } + + it('should revert when add/remove by non-owner', async function () { + const { nonOwner, compoundV3Wrapper } = await loadFixture(initContracts); + await expect(compoundV3Wrapper.connect(nonOwner).addToken(tokens.cUSDCv3)).to.be.revertedWithCustomError(compoundV3Wrapper, 'OwnableUnauthorizedAccount'); + await expect(compoundV3Wrapper.connect(nonOwner).removeToken(tokens.cWETHv3)).to.be.revertedWithCustomError(compoundV3Wrapper, 'OwnableUnauthorizedAccount'); + }); + + it('addToken', async function () { + const { compoundV3Wrapper } = await loadFixture(initContracts); + await compoundV3Wrapper.addToken(tokens.cUSDCv3); + expect(await compoundV3Wrapper.cTokenToToken(tokens.cUSDCv3)).to.equal(tokens.USDC); + expect(await compoundV3Wrapper.tokenTocToken(tokens.USDC)).to.equal(tokens.cUSDCv3); + }); + + it('removeToken', async function () { + const { compoundV3Wrapper } = await loadFixture(initContracts); + await compoundV3Wrapper.removeToken(tokens.cWETHv3); + expect(await compoundV3Wrapper.cTokenToToken(tokens.cWETHv3)).to.equal(constants.ZERO_ADDRESS); + expect(await compoundV3Wrapper.tokenTocToken(tokens.WETH)).to.equal(constants.ZERO_ADDRESS); + }); + + it('WETH -> cWETHv3', async function () { + const { wallet, compoundV3Wrapper, cWETHv3 } = await loadFixture(initContracts); + const response = await compoundV3Wrapper.wrap(tokens.WETH); + const [received] = await trackReceivedTokenAndTx(ethers.provider, cWETHv3, wallet.address, async () => cWETHv3.supply(tokens.WETH, ether('1'))); + expect(response.wrappedToken).to.equal(tokens.cWETHv3); + assertRoughlyEqualValues(response.rate, received, 1e-17); + }); + + it('cWETHv3 -> WETH', async function () { + const { wallet, compoundV3Wrapper, weth, cWETHv3 } = await loadFixture(initContracts); + await cWETHv3.supply(tokens.WETH, ether('2')); + const response = await compoundV3Wrapper.wrap(tokens.cWETHv3); + const [received] = await trackReceivedTokenAndTx(ethers.provider, weth, wallet.address, async () => cWETHv3.withdraw(tokens.WETH, ether('1'))); + expect(response.wrappedToken).to.equal(tokens.WETH); + assertRoughlyEqualValues(response.rate, received, 1e-17); + }); +}); From c6ecb78c132d59415797fe44ed2ce5f37aff5ae4 Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 12 Mar 2024 14:24:00 +0000 Subject: [PATCH 3/7] Change token control to tokens control --- contracts/wrappers/CompoundV3Wrapper.sol | 20 ++++++++++++-------- test/wrappers/CompoundV3Wrapper.js | 14 +++++++------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/contracts/wrappers/CompoundV3Wrapper.sol b/contracts/wrappers/CompoundV3Wrapper.sol index 2a5a400c..aa12705d 100644 --- a/contracts/wrappers/CompoundV3Wrapper.sol +++ b/contracts/wrappers/CompoundV3Wrapper.sol @@ -12,16 +12,20 @@ contract CompoundV3Wrapper is IWrapper, Ownable { constructor(address _owner) Ownable(_owner) {} // solhint-disable-line no-empty-blocks - function addToken(address token) external onlyOwner { - IERC20 baseToken = IERC20(IComet(token).baseToken()); - cTokenToToken[IERC20(token)] = baseToken; - tokenTocToken[baseToken] = IERC20(token); + function addMarkets(address[] memory tokens) external onlyOwner { + for (uint256 i = 0; i < tokens.length; i++) { + IERC20 baseToken = IERC20(IComet(tokens[i]).baseToken()); + cTokenToToken[IERC20(tokens[i])] = baseToken; + tokenTocToken[baseToken] = IERC20(tokens[i]); + } } - function removeToken(address token) external onlyOwner { - IERC20 baseToken = IERC20(IComet(token).baseToken()); - delete cTokenToToken[IERC20(token)]; - delete tokenTocToken[baseToken]; + function removeMarkets(address[] memory tokens) external onlyOwner { + for (uint256 i = 0; i < tokens.length; i++) { + IERC20 baseToken = IERC20(IComet(tokens[i]).baseToken()); + delete cTokenToToken[IERC20(tokens[i])]; + delete tokenTocToken[baseToken]; + } } function wrap(IERC20 token) external view override returns (IERC20 wrappedToken, uint256 rate) { diff --git a/test/wrappers/CompoundV3Wrapper.js b/test/wrappers/CompoundV3Wrapper.js index 161af33e..e6a10d67 100644 --- a/test/wrappers/CompoundV3Wrapper.js +++ b/test/wrappers/CompoundV3Wrapper.js @@ -14,7 +14,7 @@ describe('CompoundV3Wrapper', function () { const cWETHv3 = new ethers.Contract(tokens.cWETHv3, [...IERC20ABI, ...COMETABI], wallet); const weth = await ethers.getContractAt('IWETH', tokens.WETH); - await compoundV3Wrapper.addToken(tokens.cWETHv3); + await compoundV3Wrapper.addMarkets([tokens.cWETHv3]); await weth.deposit({ value: ether('2') }); await weth.approve(cWETHv3, ether('2')); @@ -23,20 +23,20 @@ describe('CompoundV3Wrapper', function () { it('should revert when add/remove by non-owner', async function () { const { nonOwner, compoundV3Wrapper } = await loadFixture(initContracts); - await expect(compoundV3Wrapper.connect(nonOwner).addToken(tokens.cUSDCv3)).to.be.revertedWithCustomError(compoundV3Wrapper, 'OwnableUnauthorizedAccount'); - await expect(compoundV3Wrapper.connect(nonOwner).removeToken(tokens.cWETHv3)).to.be.revertedWithCustomError(compoundV3Wrapper, 'OwnableUnauthorizedAccount'); + await expect(compoundV3Wrapper.connect(nonOwner).addMarkets([tokens.cUSDCv3])).to.be.revertedWithCustomError(compoundV3Wrapper, 'OwnableUnauthorizedAccount'); + await expect(compoundV3Wrapper.connect(nonOwner).removeMarkets([tokens.cWETHv3])).to.be.revertedWithCustomError(compoundV3Wrapper, 'OwnableUnauthorizedAccount'); }); - it('addToken', async function () { + it('addMarkets', async function () { const { compoundV3Wrapper } = await loadFixture(initContracts); - await compoundV3Wrapper.addToken(tokens.cUSDCv3); + await compoundV3Wrapper.addMarkets([tokens.cUSDCv3]); expect(await compoundV3Wrapper.cTokenToToken(tokens.cUSDCv3)).to.equal(tokens.USDC); expect(await compoundV3Wrapper.tokenTocToken(tokens.USDC)).to.equal(tokens.cUSDCv3); }); - it('removeToken', async function () { + it('removeMarkets', async function () { const { compoundV3Wrapper } = await loadFixture(initContracts); - await compoundV3Wrapper.removeToken(tokens.cWETHv3); + await compoundV3Wrapper.removeMarkets([tokens.cWETHv3]); expect(await compoundV3Wrapper.cTokenToToken(tokens.cWETHv3)).to.equal(constants.ZERO_ADDRESS); expect(await compoundV3Wrapper.tokenTocToken(tokens.WETH)).to.equal(constants.ZERO_ADDRESS); }); From b6ea61197963ac03096ed2dd075ead9eee1d5a1c Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 12 Mar 2024 15:29:17 +0000 Subject: [PATCH 4/7] Deploy on mainnet --- README.md | 1 + deployments/mainnet/CompoundV3Wrapper.json | 311 +++++++++++++++++++++ 2 files changed, 312 insertions(+) create mode 100644 deployments/mainnet/CompoundV3Wrapper.json diff --git a/README.md b/README.md index 3c415ab3..c4a7aec8 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ If no direct liquidity pair exists between two tokens, the spot price aggregator * AaveV2 - [0x06cC74503B6d1eB6D4d6Bc402f48fC07b804105f](https://etherscan.io/address/0x06cC74503B6d1eB6D4d6Bc402f48fC07b804105f) * AaveV3 - [0x0c8fc7a71C28c768FDC1f7d75835229beBEB1573](https://etherscan.io/address/0x0c8fc7a71C28c768FDC1f7d75835229beBEB1573) * Compound - [0x7C327E1Ee66d4cF7F4053387241351FDc95A0c04](https://etherscan.io/address/0x7C327E1Ee66d4cF7F4053387241351FDc95A0c04) + * CompoundV3 - [0xd24222B521337DABE4f1e56d351818fbf26905eD](https://etherscan.io/address/0xd24222B521337DABE4f1e56d351818fbf26905eD) * YVault - [0x9FF110f132d988bfa9bC6a21851Da1aF3aC6EaF8](https://etherscan.io/address/0x9FF110f132d988bfa9bC6a21851Da1aF3aC6EaF8) * stETH - [0x26daCf7E879b18FE658326ddD3ABC0D6910B3E9F](https://etherscan.io/address/0x26daCf7E879b18FE658326ddD3ABC0D6910B3E9F) * wstETH - [0x37eB78fE793E89353e46AEe73E299985C3B8d334](https://etherscan.io/address/0x37eB78fE793E89353e46AEe73E299985C3B8d334) diff --git a/deployments/mainnet/CompoundV3Wrapper.json b/deployments/mainnet/CompoundV3Wrapper.json new file mode 100644 index 00000000..d8018204 --- /dev/null +++ b/deployments/mainnet/CompoundV3Wrapper.json @@ -0,0 +1,311 @@ +{ + "address": "0xd24222B521337DABE4f1e56d351818fbf26905eD", + "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": "cTokenToToken", + "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": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "tokenTocToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "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": "0xc18d68c89d58954c39a775fa9749d12913bfaa672c8a9977328bc43aa1983228", + "receipt": { + "to": null, + "from": "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF", + "contractAddress": "0xd24222B521337DABE4f1e56d351818fbf26905eD", + "transactionIndex": 47, + "gasUsed": "539286", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000004000000000000008000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000804000000000000000000000000000000400000000000000000000000000000000000000000800000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000001000000000000000000000000000000000000000000", + "blockHash": "0xefdcdb632a01ff65607f55b27aab4eab0e908182cd85860963b075fdb959b17a", + "transactionHash": "0xc18d68c89d58954c39a775fa9749d12913bfaa672c8a9977328bc43aa1983228", + "logs": [ + { + "transactionIndex": 47, + "blockNumber": 19419877, + "transactionHash": "0xc18d68c89d58954c39a775fa9749d12913bfaa672c8a9977328bc43aa1983228", + "address": "0xd24222B521337DABE4f1e56d351818fbf26905eD", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000056e44874f624ebde6efcc783efd685f0fbdc6dcf" + ], + "data": "0x", + "logIndex": 173, + "blockHash": "0xefdcdb632a01ff65607f55b27aab4eab0e908182cd85860963b075fdb959b17a" + } + ], + "blockNumber": 19419877, + "cumulativeGasUsed": "5535637", + "status": 1, + "byzantium": true + }, + "args": [ + "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF" + ], + "numDeployments": 1, + "solcInputHash": "181d44fb0b4f80a8565d36f490ab3fb6", + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"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\":\"cTokenToToken\",\"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\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenTocToken\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":{\"errors\":{\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}]},\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/wrappers/CompoundV3Wrapper.sol\":\"CompoundV3Wrapper\"},\"evmVersion\":\"shanghai\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Context} from \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The initial owner is set to the address provided by the deployer. This can\\n * later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n /**\\n * @dev The caller account is not authorized to perform an operation.\\n */\\n error OwnableUnauthorizedAccount(address account);\\n\\n /**\\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\\n */\\n error OwnableInvalidOwner(address owner);\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\\n */\\n constructor(address initialOwner) {\\n if (initialOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(initialOwner);\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n if (owner() != _msgSender()) {\\n revert OwnableUnauthorizedAccount(_msgSender());\\n }\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n if (newOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"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/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"contracts/interfaces/IComet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\n// CompoundV3 money market interface\\ninterface IComet {\\n function baseToken() external view returns (address);\\n function supply(address asset, uint amount) external;\\n function withdraw(address asset, uint amount) external;\\n}\\n\",\"keccak256\":\"0x37f32281688299d831dd4ada2c0b98653a5fdf9a9e23716196a78ef38621cd74\",\"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/CompoundV3Wrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport \\\"../interfaces/IWrapper.sol\\\";\\nimport \\\"../interfaces/IComet.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract CompoundV3Wrapper is IWrapper, Ownable {\\n mapping(IERC20 => IERC20) public cTokenToToken;\\n mapping(IERC20 => IERC20) public tokenTocToken;\\n\\n constructor(address _owner) Ownable(_owner) {} // solhint-disable-line no-empty-blocks\\n\\n function addMarkets(address[] memory tokens) external onlyOwner {\\n for (uint256 i = 0; i < tokens.length; i++) {\\n IERC20 baseToken = IERC20(IComet(tokens[i]).baseToken());\\n cTokenToToken[IERC20(tokens[i])] = baseToken;\\n tokenTocToken[baseToken] = IERC20(tokens[i]);\\n }\\n }\\n\\n function removeMarkets(address[] memory tokens) external onlyOwner {\\n for (uint256 i = 0; i < tokens.length; i++) {\\n IERC20 baseToken = IERC20(IComet(tokens[i]).baseToken());\\n delete cTokenToToken[IERC20(tokens[i])];\\n delete tokenTocToken[baseToken];\\n }\\n }\\n\\n function wrap(IERC20 token) external view override returns (IERC20 wrappedToken, uint256 rate) {\\n IERC20 baseToken = cTokenToToken[token];\\n IERC20 cToken = tokenTocToken[token];\\n if (baseToken != IERC20(address(0))) {\\n return (baseToken, 1e18);\\n } else if (cToken != IERC20(address(0))) {\\n return (cToken, 1e18);\\n } else {\\n revert NotSupportedToken();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x35949268cab31b6523e4b3764756a1ea76530c07ec6ea54739a0e6d5bbe16812\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080346100b957601f61092b38819003918201601f19168301916001600160401b038311848410176100bd578084926020946040528339810103126100b957516001600160a01b0390818116908190036100b95780156100a1575f80546001600160a01b03198116831782556040519316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a361085990816100d28239f35b604051631e4fbdf760e01b81525f6004820152602490fd5b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe60406080815260049081361015610014575f80fd5b5f3560e01c8063023276f01461054957806346bfac4a146104e2578063715018a6146104485780637d683561146103e15780638da5cb5b14610390578063bfef7bdf14610280578063da40385d146101595763f2fde38b14610074575f80fd5b346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555781359173ffffffffffffffffffffffffffffffffffffffff91828416809403610155576100ce6107d3565b83156101265750505f54827fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b905f60249251917f1e4fbdf7000000000000000000000000000000000000000000000000000000008352820152fd5b5f80fd5b5090346101555761016936610620565b6101716107d3565b5f5b815181101561027e5773ffffffffffffffffffffffffffffffffffffffff908161019d8285610766565b511691855180937fc55dae63000000000000000000000000000000000000000000000000000000008252818760209384935afa801561027457826002916001965f91610247575b501691836101f28689610766565b51165f52858152885f20937fffffffffffffffffffffffff00000000000000000000000000000000000000009484868254161790556102318689610766565b5116925f5252865f209182541617905501610173565b6102679150843d861161026d575b61025f81836105b2565b8101906107a7565b5f6101e4565b503d610255565b87513d5f823e3d90fd5b005b5034610155579061029036610620565b916102996107d3565b5f925b805184101561027e5773ffffffffffffffffffffffffffffffffffffffff93846102c68284610766565b511694835180967fc55dae63000000000000000000000000000000000000000000000000000000008252818760209384935afa908115610386576001949596975f92610366575b50826002929361031d8689610766565b51165f52858252875f20937fffffffffffffffffffffffff000000000000000000000000000000000000000094858154169055165f5252845f209081541690550192919061029c565b6002925061038090823d841161026d5761025f81836105b2565b9161030d565b85513d5f823e3d90fd5b5034610155575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555760209073ffffffffffffffffffffffffffffffffffffffff5f54169051908152f35b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261015557359073ffffffffffffffffffffffffffffffffffffffff808316809303610155576020925f5260028352815f2054169051908152f35b34610155575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555761047e6107d3565b5f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261015557359073ffffffffffffffffffffffffffffffffffffffff808316809303610155576020925f5260018352815f2054169051908152f35b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610155573573ffffffffffffffffffffffffffffffffffffffff908181168103610155576105a3906106de565b90918351921682526020820152f35b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176105f357604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101555767ffffffffffffffff9160043583811161015557816023820112156101555780600401359384116105f3578360051b906040519461068c60208401876105b2565b85526024602086019282010192831161015557602401905b8282106106b2575050505090565b813573ffffffffffffffffffffffffffffffffffffffff811681036101555781529083019083016106a4565b73ffffffffffffffffffffffffffffffffffffffff8091165f5260016020528060405f20541690600260205260405f2054168115155f14610727575090670de0b6b3a764000090565b9050801561073c5790670de0b6b3a764000090565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b805182101561077a5760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b90816020910312610155575173ffffffffffffffffffffffffffffffffffffffff811681036101555790565b73ffffffffffffffffffffffffffffffffffffffff5f541633036107f357565b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fdfea2646970667358221220167daea3dd83dfba39588d5d4b7d4f5566382c6e12fce77f2ea70258ee18bc7b64736f6c63430008170033", + "deployedBytecode": "0x60406080815260049081361015610014575f80fd5b5f3560e01c8063023276f01461054957806346bfac4a146104e2578063715018a6146104485780637d683561146103e15780638da5cb5b14610390578063bfef7bdf14610280578063da40385d146101595763f2fde38b14610074575f80fd5b346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555781359173ffffffffffffffffffffffffffffffffffffffff91828416809403610155576100ce6107d3565b83156101265750505f54827fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b905f60249251917f1e4fbdf7000000000000000000000000000000000000000000000000000000008352820152fd5b5f80fd5b5090346101555761016936610620565b6101716107d3565b5f5b815181101561027e5773ffffffffffffffffffffffffffffffffffffffff908161019d8285610766565b511691855180937fc55dae63000000000000000000000000000000000000000000000000000000008252818760209384935afa801561027457826002916001965f91610247575b501691836101f28689610766565b51165f52858152885f20937fffffffffffffffffffffffff00000000000000000000000000000000000000009484868254161790556102318689610766565b5116925f5252865f209182541617905501610173565b6102679150843d861161026d575b61025f81836105b2565b8101906107a7565b5f6101e4565b503d610255565b87513d5f823e3d90fd5b005b5034610155579061029036610620565b916102996107d3565b5f925b805184101561027e5773ffffffffffffffffffffffffffffffffffffffff93846102c68284610766565b511694835180967fc55dae63000000000000000000000000000000000000000000000000000000008252818760209384935afa908115610386576001949596975f92610366575b50826002929361031d8689610766565b51165f52858252875f20937fffffffffffffffffffffffff000000000000000000000000000000000000000094858154169055165f5252845f209081541690550192919061029c565b6002925061038090823d841161026d5761025f81836105b2565b9161030d565b85513d5f823e3d90fd5b5034610155575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555760209073ffffffffffffffffffffffffffffffffffffffff5f54169051908152f35b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261015557359073ffffffffffffffffffffffffffffffffffffffff808316809303610155576020925f5260028352815f2054169051908152f35b34610155575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555761047e6107d3565b5f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261015557359073ffffffffffffffffffffffffffffffffffffffff808316809303610155576020925f5260018352815f2054169051908152f35b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610155573573ffffffffffffffffffffffffffffffffffffffff908181168103610155576105a3906106de565b90918351921682526020820152f35b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176105f357604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101555767ffffffffffffffff9160043583811161015557816023820112156101555780600401359384116105f3578360051b906040519461068c60208401876105b2565b85526024602086019282010192831161015557602401905b8282106106b2575050505090565b813573ffffffffffffffffffffffffffffffffffffffff811681036101555781529083019083016106a4565b73ffffffffffffffffffffffffffffffffffffffff8091165f5260016020528060405f20541690600260205260405f2054168115155f14610727575090670de0b6b3a764000090565b9050801561073c5790670de0b6b3a764000090565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b805182101561077a5760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b90816020910312610155575173ffffffffffffffffffffffffffffffffffffffff811681036101555790565b73ffffffffffffffffffffffffffffffffffffffff5f541633036107f357565b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fdfea2646970667358221220167daea3dd83dfba39588d5d4b7d4f5566382c6e12fce77f2ea70258ee18bc7b64736f6c63430008170033", + "devdoc": { + "errors": { + "OwnableInvalidOwner(address)": [ + { + "details": "The owner is not a valid owner account. (eg. `address(0)`)" + } + ], + "OwnableUnauthorizedAccount(address)": [ + { + "details": "The caller account is not authorized to perform an operation." + } + ] + }, + "kind": "dev", + "methods": { + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 8, + "contract": "contracts/wrappers/CompoundV3Wrapper.sol:CompoundV3Wrapper", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 313, + "contract": "contracts/wrappers/CompoundV3Wrapper.sol:CompoundV3Wrapper", + "label": "cTokenToToken", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_contract(IERC20)225,t_contract(IERC20)225)" + }, + { + "astId": 319, + "contract": "contracts/wrappers/CompoundV3Wrapper.sol:CompoundV3Wrapper", + "label": "tokenTocToken", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_contract(IERC20)225,t_contract(IERC20)225)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_contract(IERC20)225": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_contract(IERC20)225,t_contract(IERC20)225)": { + "encoding": "mapping", + "key": "t_contract(IERC20)225", + "label": "mapping(contract IERC20 => contract IERC20)", + "numberOfBytes": "32", + "value": "t_contract(IERC20)225" + } + } + } +} \ No newline at end of file From e3fed641df5c7f9ff5401777fdc1b2f18fcf4daa Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 12 Mar 2024 15:38:49 +0000 Subject: [PATCH 5/7] Deploy on polygon --- README.md | 1 + deployments/matic/CompoundV3Wrapper.json | 326 +++++++++++++++++++++++ 2 files changed, 327 insertions(+) create mode 100644 deployments/matic/CompoundV3Wrapper.json diff --git a/README.md b/README.md index c4a7aec8..b25f591c 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ If no direct liquidity pair exists between two tokens, the spot price aggregator * WMATIC - [0xA0446D8804611944F1B527eCD37d7dcbE442caba](https://polygonscan.com/address/0xA0446D8804611944F1B527eCD37d7dcbE442caba) * AaveV2 - [0x138CE40d675F9a23E4D6127A8600308Cf7A93381](https://polygonscan.com/address/0x138CE40d675F9a23E4D6127A8600308Cf7A93381) * AaveV3 - [0x0c8fc7a71C28c768FDC1f7d75835229beBEB1573](https://polygonscan.com/address/0x0c8fc7a71C28c768FDC1f7d75835229beBEB1573) + * CompoundV3 - [0xAc63D130525c251EbB24E010c2959a98c80B993a](https://polygonscan.com/address/0xAc63D130525c251EbB24E010c2959a98c80B993a) diff --git a/deployments/matic/CompoundV3Wrapper.json b/deployments/matic/CompoundV3Wrapper.json new file mode 100644 index 00000000..1552c7ab --- /dev/null +++ b/deployments/matic/CompoundV3Wrapper.json @@ -0,0 +1,326 @@ +{ + "address": "0xAc63D130525c251EbB24E010c2959a98c80B993a", + "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": "cTokenToToken", + "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": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "tokenTocToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "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": "0x077958241b08b54574bd2c8be85d811afab36b54d2e0e29ed95f4a8ebf4145ba", + "receipt": { + "to": null, + "from": "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF", + "contractAddress": "0xAc63D130525c251EbB24E010c2959a98c80B993a", + "transactionIndex": 59, + "gasUsed": "539286", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000020000000000000000000000000000000004000000008000008000000000000000000000000000000000008000000000000000800001000000000000000100000000000000000000020000000000000000000800000000000800100080000000000000400000000000000000000000000000000000000000000000020000000000000000200000000002000000000000000000000000000000000000000000000000004000000000000000000001000000000000000000000000000000100000000020000000000000000000000000000000000000000800000000000000000000100000", + "blockHash": "0x081a4b009e7eb3d57857763a045fd2a6849f83cfd486f46c2414e9b5759a6f2e", + "transactionHash": "0x077958241b08b54574bd2c8be85d811afab36b54d2e0e29ed95f4a8ebf4145ba", + "logs": [ + { + "transactionIndex": 59, + "blockNumber": 54574523, + "transactionHash": "0x077958241b08b54574bd2c8be85d811afab36b54d2e0e29ed95f4a8ebf4145ba", + "address": "0xAc63D130525c251EbB24E010c2959a98c80B993a", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000056e44874f624ebde6efcc783efd685f0fbdc6dcf" + ], + "data": "0x", + "logIndex": 257, + "blockHash": "0x081a4b009e7eb3d57857763a045fd2a6849f83cfd486f46c2414e9b5759a6f2e" + }, + { + "transactionIndex": 59, + "blockNumber": 54574523, + "transactionHash": "0x077958241b08b54574bd2c8be85d811afab36b54d2e0e29ed95f4a8ebf4145ba", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x00000000000000000000000056e44874f624ebde6efcc783efd685f0fbdc6dcf", + "0x00000000000000000000000083d69448f88bf9c701c1b93f43e1f753d39b2632" + ], + "data": "0x000000000000000000000000000000000000000000000000003b7afcb00f138c00000000000000000000000000000000000000000000000720472735f4ffc43b0000000000000000000000000000000000000000000002a18941b3577688454e000000000000000000000000000000000000000000000007200bac3944f0b0af0000000000000000000000000000000000000000000002a1897d2e54269758da", + "logIndex": 258, + "blockHash": "0x081a4b009e7eb3d57857763a045fd2a6849f83cfd486f46c2414e9b5759a6f2e" + } + ], + "blockNumber": 54574523, + "cumulativeGasUsed": "13118494", + "status": 1, + "byzantium": true + }, + "args": [ + "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF" + ], + "numDeployments": 1, + "solcInputHash": "181d44fb0b4f80a8565d36f490ab3fb6", + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"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\":\"cTokenToToken\",\"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\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenTocToken\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":{\"errors\":{\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}]},\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/wrappers/CompoundV3Wrapper.sol\":\"CompoundV3Wrapper\"},\"evmVersion\":\"shanghai\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Context} from \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The initial owner is set to the address provided by the deployer. This can\\n * later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n /**\\n * @dev The caller account is not authorized to perform an operation.\\n */\\n error OwnableUnauthorizedAccount(address account);\\n\\n /**\\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\\n */\\n error OwnableInvalidOwner(address owner);\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\\n */\\n constructor(address initialOwner) {\\n if (initialOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(initialOwner);\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n if (owner() != _msgSender()) {\\n revert OwnableUnauthorizedAccount(_msgSender());\\n }\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n if (newOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"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/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"contracts/interfaces/IComet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\n// CompoundV3 money market interface\\ninterface IComet {\\n function baseToken() external view returns (address);\\n function supply(address asset, uint amount) external;\\n function withdraw(address asset, uint amount) external;\\n}\\n\",\"keccak256\":\"0x37f32281688299d831dd4ada2c0b98653a5fdf9a9e23716196a78ef38621cd74\",\"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/CompoundV3Wrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport \\\"../interfaces/IWrapper.sol\\\";\\nimport \\\"../interfaces/IComet.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract CompoundV3Wrapper is IWrapper, Ownable {\\n mapping(IERC20 => IERC20) public cTokenToToken;\\n mapping(IERC20 => IERC20) public tokenTocToken;\\n\\n constructor(address _owner) Ownable(_owner) {} // solhint-disable-line no-empty-blocks\\n\\n function addMarkets(address[] memory tokens) external onlyOwner {\\n for (uint256 i = 0; i < tokens.length; i++) {\\n IERC20 baseToken = IERC20(IComet(tokens[i]).baseToken());\\n cTokenToToken[IERC20(tokens[i])] = baseToken;\\n tokenTocToken[baseToken] = IERC20(tokens[i]);\\n }\\n }\\n\\n function removeMarkets(address[] memory tokens) external onlyOwner {\\n for (uint256 i = 0; i < tokens.length; i++) {\\n IERC20 baseToken = IERC20(IComet(tokens[i]).baseToken());\\n delete cTokenToToken[IERC20(tokens[i])];\\n delete tokenTocToken[baseToken];\\n }\\n }\\n\\n function wrap(IERC20 token) external view override returns (IERC20 wrappedToken, uint256 rate) {\\n IERC20 baseToken = cTokenToToken[token];\\n IERC20 cToken = tokenTocToken[token];\\n if (baseToken != IERC20(address(0))) {\\n return (baseToken, 1e18);\\n } else if (cToken != IERC20(address(0))) {\\n return (cToken, 1e18);\\n } else {\\n revert NotSupportedToken();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x35949268cab31b6523e4b3764756a1ea76530c07ec6ea54739a0e6d5bbe16812\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080346100b957601f61092b38819003918201601f19168301916001600160401b038311848410176100bd578084926020946040528339810103126100b957516001600160a01b0390818116908190036100b95780156100a1575f80546001600160a01b03198116831782556040519316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a361085990816100d28239f35b604051631e4fbdf760e01b81525f6004820152602490fd5b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe60406080815260049081361015610014575f80fd5b5f3560e01c8063023276f01461054957806346bfac4a146104e2578063715018a6146104485780637d683561146103e15780638da5cb5b14610390578063bfef7bdf14610280578063da40385d146101595763f2fde38b14610074575f80fd5b346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555781359173ffffffffffffffffffffffffffffffffffffffff91828416809403610155576100ce6107d3565b83156101265750505f54827fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b905f60249251917f1e4fbdf7000000000000000000000000000000000000000000000000000000008352820152fd5b5f80fd5b5090346101555761016936610620565b6101716107d3565b5f5b815181101561027e5773ffffffffffffffffffffffffffffffffffffffff908161019d8285610766565b511691855180937fc55dae63000000000000000000000000000000000000000000000000000000008252818760209384935afa801561027457826002916001965f91610247575b501691836101f28689610766565b51165f52858152885f20937fffffffffffffffffffffffff00000000000000000000000000000000000000009484868254161790556102318689610766565b5116925f5252865f209182541617905501610173565b6102679150843d861161026d575b61025f81836105b2565b8101906107a7565b5f6101e4565b503d610255565b87513d5f823e3d90fd5b005b5034610155579061029036610620565b916102996107d3565b5f925b805184101561027e5773ffffffffffffffffffffffffffffffffffffffff93846102c68284610766565b511694835180967fc55dae63000000000000000000000000000000000000000000000000000000008252818760209384935afa908115610386576001949596975f92610366575b50826002929361031d8689610766565b51165f52858252875f20937fffffffffffffffffffffffff000000000000000000000000000000000000000094858154169055165f5252845f209081541690550192919061029c565b6002925061038090823d841161026d5761025f81836105b2565b9161030d565b85513d5f823e3d90fd5b5034610155575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555760209073ffffffffffffffffffffffffffffffffffffffff5f54169051908152f35b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261015557359073ffffffffffffffffffffffffffffffffffffffff808316809303610155576020925f5260028352815f2054169051908152f35b34610155575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555761047e6107d3565b5f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261015557359073ffffffffffffffffffffffffffffffffffffffff808316809303610155576020925f5260018352815f2054169051908152f35b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610155573573ffffffffffffffffffffffffffffffffffffffff908181168103610155576105a3906106de565b90918351921682526020820152f35b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176105f357604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101555767ffffffffffffffff9160043583811161015557816023820112156101555780600401359384116105f3578360051b906040519461068c60208401876105b2565b85526024602086019282010192831161015557602401905b8282106106b2575050505090565b813573ffffffffffffffffffffffffffffffffffffffff811681036101555781529083019083016106a4565b73ffffffffffffffffffffffffffffffffffffffff8091165f5260016020528060405f20541690600260205260405f2054168115155f14610727575090670de0b6b3a764000090565b9050801561073c5790670de0b6b3a764000090565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b805182101561077a5760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b90816020910312610155575173ffffffffffffffffffffffffffffffffffffffff811681036101555790565b73ffffffffffffffffffffffffffffffffffffffff5f541633036107f357565b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fdfea2646970667358221220167daea3dd83dfba39588d5d4b7d4f5566382c6e12fce77f2ea70258ee18bc7b64736f6c63430008170033", + "deployedBytecode": "0x60406080815260049081361015610014575f80fd5b5f3560e01c8063023276f01461054957806346bfac4a146104e2578063715018a6146104485780637d683561146103e15780638da5cb5b14610390578063bfef7bdf14610280578063da40385d146101595763f2fde38b14610074575f80fd5b346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555781359173ffffffffffffffffffffffffffffffffffffffff91828416809403610155576100ce6107d3565b83156101265750505f54827fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b905f60249251917f1e4fbdf7000000000000000000000000000000000000000000000000000000008352820152fd5b5f80fd5b5090346101555761016936610620565b6101716107d3565b5f5b815181101561027e5773ffffffffffffffffffffffffffffffffffffffff908161019d8285610766565b511691855180937fc55dae63000000000000000000000000000000000000000000000000000000008252818760209384935afa801561027457826002916001965f91610247575b501691836101f28689610766565b51165f52858152885f20937fffffffffffffffffffffffff00000000000000000000000000000000000000009484868254161790556102318689610766565b5116925f5252865f209182541617905501610173565b6102679150843d861161026d575b61025f81836105b2565b8101906107a7565b5f6101e4565b503d610255565b87513d5f823e3d90fd5b005b5034610155579061029036610620565b916102996107d3565b5f925b805184101561027e5773ffffffffffffffffffffffffffffffffffffffff93846102c68284610766565b511694835180967fc55dae63000000000000000000000000000000000000000000000000000000008252818760209384935afa908115610386576001949596975f92610366575b50826002929361031d8689610766565b51165f52858252875f20937fffffffffffffffffffffffff000000000000000000000000000000000000000094858154169055165f5252845f209081541690550192919061029c565b6002925061038090823d841161026d5761025f81836105b2565b9161030d565b85513d5f823e3d90fd5b5034610155575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555760209073ffffffffffffffffffffffffffffffffffffffff5f54169051908152f35b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261015557359073ffffffffffffffffffffffffffffffffffffffff808316809303610155576020925f5260028352815f2054169051908152f35b34610155575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555761047e6107d3565b5f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261015557359073ffffffffffffffffffffffffffffffffffffffff808316809303610155576020925f5260018352815f2054169051908152f35b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610155573573ffffffffffffffffffffffffffffffffffffffff908181168103610155576105a3906106de565b90918351921682526020820152f35b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176105f357604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101555767ffffffffffffffff9160043583811161015557816023820112156101555780600401359384116105f3578360051b906040519461068c60208401876105b2565b85526024602086019282010192831161015557602401905b8282106106b2575050505090565b813573ffffffffffffffffffffffffffffffffffffffff811681036101555781529083019083016106a4565b73ffffffffffffffffffffffffffffffffffffffff8091165f5260016020528060405f20541690600260205260405f2054168115155f14610727575090670de0b6b3a764000090565b9050801561073c5790670de0b6b3a764000090565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b805182101561077a5760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b90816020910312610155575173ffffffffffffffffffffffffffffffffffffffff811681036101555790565b73ffffffffffffffffffffffffffffffffffffffff5f541633036107f357565b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fdfea2646970667358221220167daea3dd83dfba39588d5d4b7d4f5566382c6e12fce77f2ea70258ee18bc7b64736f6c63430008170033", + "devdoc": { + "errors": { + "OwnableInvalidOwner(address)": [ + { + "details": "The owner is not a valid owner account. (eg. `address(0)`)" + } + ], + "OwnableUnauthorizedAccount(address)": [ + { + "details": "The caller account is not authorized to perform an operation." + } + ] + }, + "kind": "dev", + "methods": { + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 8, + "contract": "contracts/wrappers/CompoundV3Wrapper.sol:CompoundV3Wrapper", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 313, + "contract": "contracts/wrappers/CompoundV3Wrapper.sol:CompoundV3Wrapper", + "label": "cTokenToToken", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_contract(IERC20)225,t_contract(IERC20)225)" + }, + { + "astId": 319, + "contract": "contracts/wrappers/CompoundV3Wrapper.sol:CompoundV3Wrapper", + "label": "tokenTocToken", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_contract(IERC20)225,t_contract(IERC20)225)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_contract(IERC20)225": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_contract(IERC20)225,t_contract(IERC20)225)": { + "encoding": "mapping", + "key": "t_contract(IERC20)225", + "label": "mapping(contract IERC20 => contract IERC20)", + "numberOfBytes": "32", + "value": "t_contract(IERC20)225" + } + } + } +} \ No newline at end of file From ff4714110a81fa599df76726bb0cff1501f00587 Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 12 Mar 2024 15:42:51 +0000 Subject: [PATCH 6/7] Deploy on arbitrum --- README.md | 1 + deployments/arbitrum/CompoundV3Wrapper.json | 311 ++++++++++++++++++++ 2 files changed, 312 insertions(+) create mode 100644 deployments/arbitrum/CompoundV3Wrapper.json diff --git a/README.md b/README.md index b25f591c..c3bd974f 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,7 @@ If no direct liquidity pair exists between two tokens, the spot price aggregator * WETH - [0x0F85A912448279111694F4Ba4F85dC641c54b594](https://arbiscan.io/address/0x0F85A912448279111694F4Ba4F85dC641c54b594) * AaveV3 - [0x0c8fc7a71C28c768FDC1f7d75835229beBEB1573](https://arbiscan.io/address/0x0c8fc7a71C28c768FDC1f7d75835229beBEB1573) + * CompoundV3 - [0x04098C93b15E5Cbb5A49651f20218C85F202Cd27](https://arbiscan.io/address/0x04098C93b15E5Cbb5A49651f20218C85F202Cd27) diff --git a/deployments/arbitrum/CompoundV3Wrapper.json b/deployments/arbitrum/CompoundV3Wrapper.json new file mode 100644 index 00000000..77d54dbb --- /dev/null +++ b/deployments/arbitrum/CompoundV3Wrapper.json @@ -0,0 +1,311 @@ +{ + "address": "0x04098C93b15E5Cbb5A49651f20218C85F202Cd27", + "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": "cTokenToToken", + "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": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "tokenTocToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "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": "0xe89d844caa513240759a55535b67d82563d3a2021fe729431c35d2f684d1c813", + "receipt": { + "to": null, + "from": "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF", + "contractAddress": "0x04098C93b15E5Cbb5A49651f20218C85F202Cd27", + "transactionIndex": 2, + "gasUsed": "18958383", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000004000000000000008000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000020000000000000000000000000000002000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000004000000000000000000000000", + "blockHash": "0xfaebead21751b260a36f342a61a712493acd08699c561253f0c7dea2bb58c95d", + "transactionHash": "0xe89d844caa513240759a55535b67d82563d3a2021fe729431c35d2f684d1c813", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 189663833, + "transactionHash": "0xe89d844caa513240759a55535b67d82563d3a2021fe729431c35d2f684d1c813", + "address": "0x04098C93b15E5Cbb5A49651f20218C85F202Cd27", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000056e44874f624ebde6efcc783efd685f0fbdc6dcf" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0xfaebead21751b260a36f342a61a712493acd08699c561253f0c7dea2bb58c95d" + } + ], + "blockNumber": 189663833, + "cumulativeGasUsed": "21272738", + "status": 1, + "byzantium": true + }, + "args": [ + "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF" + ], + "numDeployments": 1, + "solcInputHash": "181d44fb0b4f80a8565d36f490ab3fb6", + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"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\":\"cTokenToToken\",\"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\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenTocToken\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":{\"errors\":{\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}]},\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/wrappers/CompoundV3Wrapper.sol\":\"CompoundV3Wrapper\"},\"evmVersion\":\"shanghai\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Context} from \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The initial owner is set to the address provided by the deployer. This can\\n * later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n /**\\n * @dev The caller account is not authorized to perform an operation.\\n */\\n error OwnableUnauthorizedAccount(address account);\\n\\n /**\\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\\n */\\n error OwnableInvalidOwner(address owner);\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\\n */\\n constructor(address initialOwner) {\\n if (initialOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(initialOwner);\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n if (owner() != _msgSender()) {\\n revert OwnableUnauthorizedAccount(_msgSender());\\n }\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n if (newOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"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/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"contracts/interfaces/IComet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\n// CompoundV3 money market interface\\ninterface IComet {\\n function baseToken() external view returns (address);\\n function supply(address asset, uint amount) external;\\n function withdraw(address asset, uint amount) external;\\n}\\n\",\"keccak256\":\"0x37f32281688299d831dd4ada2c0b98653a5fdf9a9e23716196a78ef38621cd74\",\"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/CompoundV3Wrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport \\\"../interfaces/IWrapper.sol\\\";\\nimport \\\"../interfaces/IComet.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract CompoundV3Wrapper is IWrapper, Ownable {\\n mapping(IERC20 => IERC20) public cTokenToToken;\\n mapping(IERC20 => IERC20) public tokenTocToken;\\n\\n constructor(address _owner) Ownable(_owner) {} // solhint-disable-line no-empty-blocks\\n\\n function addMarkets(address[] memory tokens) external onlyOwner {\\n for (uint256 i = 0; i < tokens.length; i++) {\\n IERC20 baseToken = IERC20(IComet(tokens[i]).baseToken());\\n cTokenToToken[IERC20(tokens[i])] = baseToken;\\n tokenTocToken[baseToken] = IERC20(tokens[i]);\\n }\\n }\\n\\n function removeMarkets(address[] memory tokens) external onlyOwner {\\n for (uint256 i = 0; i < tokens.length; i++) {\\n IERC20 baseToken = IERC20(IComet(tokens[i]).baseToken());\\n delete cTokenToToken[IERC20(tokens[i])];\\n delete tokenTocToken[baseToken];\\n }\\n }\\n\\n function wrap(IERC20 token) external view override returns (IERC20 wrappedToken, uint256 rate) {\\n IERC20 baseToken = cTokenToToken[token];\\n IERC20 cToken = tokenTocToken[token];\\n if (baseToken != IERC20(address(0))) {\\n return (baseToken, 1e18);\\n } else if (cToken != IERC20(address(0))) {\\n return (cToken, 1e18);\\n } else {\\n revert NotSupportedToken();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x35949268cab31b6523e4b3764756a1ea76530c07ec6ea54739a0e6d5bbe16812\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080346100b957601f61092b38819003918201601f19168301916001600160401b038311848410176100bd578084926020946040528339810103126100b957516001600160a01b0390818116908190036100b95780156100a1575f80546001600160a01b03198116831782556040519316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a361085990816100d28239f35b604051631e4fbdf760e01b81525f6004820152602490fd5b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe60406080815260049081361015610014575f80fd5b5f3560e01c8063023276f01461054957806346bfac4a146104e2578063715018a6146104485780637d683561146103e15780638da5cb5b14610390578063bfef7bdf14610280578063da40385d146101595763f2fde38b14610074575f80fd5b346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555781359173ffffffffffffffffffffffffffffffffffffffff91828416809403610155576100ce6107d3565b83156101265750505f54827fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b905f60249251917f1e4fbdf7000000000000000000000000000000000000000000000000000000008352820152fd5b5f80fd5b5090346101555761016936610620565b6101716107d3565b5f5b815181101561027e5773ffffffffffffffffffffffffffffffffffffffff908161019d8285610766565b511691855180937fc55dae63000000000000000000000000000000000000000000000000000000008252818760209384935afa801561027457826002916001965f91610247575b501691836101f28689610766565b51165f52858152885f20937fffffffffffffffffffffffff00000000000000000000000000000000000000009484868254161790556102318689610766565b5116925f5252865f209182541617905501610173565b6102679150843d861161026d575b61025f81836105b2565b8101906107a7565b5f6101e4565b503d610255565b87513d5f823e3d90fd5b005b5034610155579061029036610620565b916102996107d3565b5f925b805184101561027e5773ffffffffffffffffffffffffffffffffffffffff93846102c68284610766565b511694835180967fc55dae63000000000000000000000000000000000000000000000000000000008252818760209384935afa908115610386576001949596975f92610366575b50826002929361031d8689610766565b51165f52858252875f20937fffffffffffffffffffffffff000000000000000000000000000000000000000094858154169055165f5252845f209081541690550192919061029c565b6002925061038090823d841161026d5761025f81836105b2565b9161030d565b85513d5f823e3d90fd5b5034610155575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555760209073ffffffffffffffffffffffffffffffffffffffff5f54169051908152f35b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261015557359073ffffffffffffffffffffffffffffffffffffffff808316809303610155576020925f5260028352815f2054169051908152f35b34610155575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555761047e6107d3565b5f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261015557359073ffffffffffffffffffffffffffffffffffffffff808316809303610155576020925f5260018352815f2054169051908152f35b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610155573573ffffffffffffffffffffffffffffffffffffffff908181168103610155576105a3906106de565b90918351921682526020820152f35b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176105f357604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101555767ffffffffffffffff9160043583811161015557816023820112156101555780600401359384116105f3578360051b906040519461068c60208401876105b2565b85526024602086019282010192831161015557602401905b8282106106b2575050505090565b813573ffffffffffffffffffffffffffffffffffffffff811681036101555781529083019083016106a4565b73ffffffffffffffffffffffffffffffffffffffff8091165f5260016020528060405f20541690600260205260405f2054168115155f14610727575090670de0b6b3a764000090565b9050801561073c5790670de0b6b3a764000090565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b805182101561077a5760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b90816020910312610155575173ffffffffffffffffffffffffffffffffffffffff811681036101555790565b73ffffffffffffffffffffffffffffffffffffffff5f541633036107f357565b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fdfea2646970667358221220167daea3dd83dfba39588d5d4b7d4f5566382c6e12fce77f2ea70258ee18bc7b64736f6c63430008170033", + "deployedBytecode": "0x60406080815260049081361015610014575f80fd5b5f3560e01c8063023276f01461054957806346bfac4a146104e2578063715018a6146104485780637d683561146103e15780638da5cb5b14610390578063bfef7bdf14610280578063da40385d146101595763f2fde38b14610074575f80fd5b346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555781359173ffffffffffffffffffffffffffffffffffffffff91828416809403610155576100ce6107d3565b83156101265750505f54827fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b905f60249251917f1e4fbdf7000000000000000000000000000000000000000000000000000000008352820152fd5b5f80fd5b5090346101555761016936610620565b6101716107d3565b5f5b815181101561027e5773ffffffffffffffffffffffffffffffffffffffff908161019d8285610766565b511691855180937fc55dae63000000000000000000000000000000000000000000000000000000008252818760209384935afa801561027457826002916001965f91610247575b501691836101f28689610766565b51165f52858152885f20937fffffffffffffffffffffffff00000000000000000000000000000000000000009484868254161790556102318689610766565b5116925f5252865f209182541617905501610173565b6102679150843d861161026d575b61025f81836105b2565b8101906107a7565b5f6101e4565b503d610255565b87513d5f823e3d90fd5b005b5034610155579061029036610620565b916102996107d3565b5f925b805184101561027e5773ffffffffffffffffffffffffffffffffffffffff93846102c68284610766565b511694835180967fc55dae63000000000000000000000000000000000000000000000000000000008252818760209384935afa908115610386576001949596975f92610366575b50826002929361031d8689610766565b51165f52858252875f20937fffffffffffffffffffffffff000000000000000000000000000000000000000094858154169055165f5252845f209081541690550192919061029c565b6002925061038090823d841161026d5761025f81836105b2565b9161030d565b85513d5f823e3d90fd5b5034610155575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555760209073ffffffffffffffffffffffffffffffffffffffff5f54169051908152f35b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261015557359073ffffffffffffffffffffffffffffffffffffffff808316809303610155576020925f5260028352815f2054169051908152f35b34610155575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555761047e6107d3565b5f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261015557359073ffffffffffffffffffffffffffffffffffffffff808316809303610155576020925f5260018352815f2054169051908152f35b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610155573573ffffffffffffffffffffffffffffffffffffffff908181168103610155576105a3906106de565b90918351921682526020820152f35b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176105f357604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101555767ffffffffffffffff9160043583811161015557816023820112156101555780600401359384116105f3578360051b906040519461068c60208401876105b2565b85526024602086019282010192831161015557602401905b8282106106b2575050505090565b813573ffffffffffffffffffffffffffffffffffffffff811681036101555781529083019083016106a4565b73ffffffffffffffffffffffffffffffffffffffff8091165f5260016020528060405f20541690600260205260405f2054168115155f14610727575090670de0b6b3a764000090565b9050801561073c5790670de0b6b3a764000090565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b805182101561077a5760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b90816020910312610155575173ffffffffffffffffffffffffffffffffffffffff811681036101555790565b73ffffffffffffffffffffffffffffffffffffffff5f541633036107f357565b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fdfea2646970667358221220167daea3dd83dfba39588d5d4b7d4f5566382c6e12fce77f2ea70258ee18bc7b64736f6c63430008170033", + "devdoc": { + "errors": { + "OwnableInvalidOwner(address)": [ + { + "details": "The owner is not a valid owner account. (eg. `address(0)`)" + } + ], + "OwnableUnauthorizedAccount(address)": [ + { + "details": "The caller account is not authorized to perform an operation." + } + ] + }, + "kind": "dev", + "methods": { + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 8, + "contract": "contracts/wrappers/CompoundV3Wrapper.sol:CompoundV3Wrapper", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 313, + "contract": "contracts/wrappers/CompoundV3Wrapper.sol:CompoundV3Wrapper", + "label": "cTokenToToken", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_contract(IERC20)225,t_contract(IERC20)225)" + }, + { + "astId": 319, + "contract": "contracts/wrappers/CompoundV3Wrapper.sol:CompoundV3Wrapper", + "label": "tokenTocToken", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_contract(IERC20)225,t_contract(IERC20)225)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_contract(IERC20)225": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_contract(IERC20)225,t_contract(IERC20)225)": { + "encoding": "mapping", + "key": "t_contract(IERC20)225", + "label": "mapping(contract IERC20 => contract IERC20)", + "numberOfBytes": "32", + "value": "t_contract(IERC20)225" + } + } + } +} \ No newline at end of file From efd795beec92442ae5ec9a6dfbf247609958a220 Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 12 Mar 2024 15:45:33 +0000 Subject: [PATCH 7/7] Deploy on base --- README.md | 1 + deployments/base/CompoundV3Wrapper.json | 311 ++++++++++++++++++++++++ 2 files changed, 312 insertions(+) create mode 100644 deployments/base/CompoundV3Wrapper.json diff --git a/README.md b/README.md index c3bd974f..cad50dcc 100644 --- a/README.md +++ b/README.md @@ -491,6 +491,7 @@ If no direct liquidity pair exists between two tokens, the spot price aggregator * WETH - [0x3Ce81621e674Db129033548CbB9FF31AEDCc1BF6](https://basescan.org/address/0x3Ce81621e674Db129033548CbB9FF31AEDCc1BF6) * AaveV3 - [0x0c8fc7a71C28c768FDC1f7d75835229beBEB1573](https://basescan.org/address/0x0c8fc7a71C28c768FDC1f7d75835229beBEB1573) + * CompoundV3 - [0x3afA12cf9Ac1a96845973BD93dBEa183A94DD74F](https://basescan.org/address/0x3afA12cf9Ac1a96845973BD93dBEa183A94DD74F) diff --git a/deployments/base/CompoundV3Wrapper.json b/deployments/base/CompoundV3Wrapper.json new file mode 100644 index 00000000..ff4549d6 --- /dev/null +++ b/deployments/base/CompoundV3Wrapper.json @@ -0,0 +1,311 @@ +{ + "address": "0x3afA12cf9Ac1a96845973BD93dBEa183A94DD74F", + "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": "cTokenToToken", + "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": "contract IERC20", + "name": "", + "type": "address" + } + ], + "name": "tokenTocToken", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "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": "0x2e54fa09eddee5591e6a2c7908f517da9358c8624ef4cbc263baa88b4a6df04d", + "receipt": { + "to": null, + "from": "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF", + "contractAddress": "0x3afA12cf9Ac1a96845973BD93dBEa183A94DD74F", + "transactionIndex": 8, + "gasUsed": "539286", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000004000000000000008000000000000000000000000000000000000000000000000000000001000000000040000000000000000000000000020000000000000000000800000000000010000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x265a82409a386aabe5447f734ce786dae67bca9b44316f8c758601544569394a", + "transactionHash": "0x2e54fa09eddee5591e6a2c7908f517da9358c8624ef4cbc263baa88b4a6df04d", + "logs": [ + { + "transactionIndex": 8, + "blockNumber": 11734440, + "transactionHash": "0x2e54fa09eddee5591e6a2c7908f517da9358c8624ef4cbc263baa88b4a6df04d", + "address": "0x3afA12cf9Ac1a96845973BD93dBEa183A94DD74F", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000056e44874f624ebde6efcc783efd685f0fbdc6dcf" + ], + "data": "0x", + "logIndex": 33, + "blockHash": "0x265a82409a386aabe5447f734ce786dae67bca9b44316f8c758601544569394a" + } + ], + "blockNumber": 11734440, + "cumulativeGasUsed": "1859259", + "status": 1, + "byzantium": true + }, + "args": [ + "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF" + ], + "numDeployments": 1, + "solcInputHash": "181d44fb0b4f80a8565d36f490ab3fb6", + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"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\":\"cTokenToToken\",\"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\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenTocToken\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":{\"errors\":{\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}]},\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/wrappers/CompoundV3Wrapper.sol\":\"CompoundV3Wrapper\"},\"evmVersion\":\"shanghai\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Context} from \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * The initial owner is set to the address provided by the deployer. This can\\n * later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n /**\\n * @dev The caller account is not authorized to perform an operation.\\n */\\n error OwnableUnauthorizedAccount(address account);\\n\\n /**\\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\\n */\\n error OwnableInvalidOwner(address owner);\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\\n */\\n constructor(address initialOwner) {\\n if (initialOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(initialOwner);\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n if (owner() != _msgSender()) {\\n revert OwnableUnauthorizedAccount(_msgSender());\\n }\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n if (newOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"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/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"contracts/interfaces/IComet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\n// CompoundV3 money market interface\\ninterface IComet {\\n function baseToken() external view returns (address);\\n function supply(address asset, uint amount) external;\\n function withdraw(address asset, uint amount) external;\\n}\\n\",\"keccak256\":\"0x37f32281688299d831dd4ada2c0b98653a5fdf9a9e23716196a78ef38621cd74\",\"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/CompoundV3Wrapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport \\\"../interfaces/IWrapper.sol\\\";\\nimport \\\"../interfaces/IComet.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract CompoundV3Wrapper is IWrapper, Ownable {\\n mapping(IERC20 => IERC20) public cTokenToToken;\\n mapping(IERC20 => IERC20) public tokenTocToken;\\n\\n constructor(address _owner) Ownable(_owner) {} // solhint-disable-line no-empty-blocks\\n\\n function addMarkets(address[] memory tokens) external onlyOwner {\\n for (uint256 i = 0; i < tokens.length; i++) {\\n IERC20 baseToken = IERC20(IComet(tokens[i]).baseToken());\\n cTokenToToken[IERC20(tokens[i])] = baseToken;\\n tokenTocToken[baseToken] = IERC20(tokens[i]);\\n }\\n }\\n\\n function removeMarkets(address[] memory tokens) external onlyOwner {\\n for (uint256 i = 0; i < tokens.length; i++) {\\n IERC20 baseToken = IERC20(IComet(tokens[i]).baseToken());\\n delete cTokenToToken[IERC20(tokens[i])];\\n delete tokenTocToken[baseToken];\\n }\\n }\\n\\n function wrap(IERC20 token) external view override returns (IERC20 wrappedToken, uint256 rate) {\\n IERC20 baseToken = cTokenToToken[token];\\n IERC20 cToken = tokenTocToken[token];\\n if (baseToken != IERC20(address(0))) {\\n return (baseToken, 1e18);\\n } else if (cToken != IERC20(address(0))) {\\n return (cToken, 1e18);\\n } else {\\n revert NotSupportedToken();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x35949268cab31b6523e4b3764756a1ea76530c07ec6ea54739a0e6d5bbe16812\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080346100b957601f61092b38819003918201601f19168301916001600160401b038311848410176100bd578084926020946040528339810103126100b957516001600160a01b0390818116908190036100b95780156100a1575f80546001600160a01b03198116831782556040519316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a361085990816100d28239f35b604051631e4fbdf760e01b81525f6004820152602490fd5b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe60406080815260049081361015610014575f80fd5b5f3560e01c8063023276f01461054957806346bfac4a146104e2578063715018a6146104485780637d683561146103e15780638da5cb5b14610390578063bfef7bdf14610280578063da40385d146101595763f2fde38b14610074575f80fd5b346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555781359173ffffffffffffffffffffffffffffffffffffffff91828416809403610155576100ce6107d3565b83156101265750505f54827fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b905f60249251917f1e4fbdf7000000000000000000000000000000000000000000000000000000008352820152fd5b5f80fd5b5090346101555761016936610620565b6101716107d3565b5f5b815181101561027e5773ffffffffffffffffffffffffffffffffffffffff908161019d8285610766565b511691855180937fc55dae63000000000000000000000000000000000000000000000000000000008252818760209384935afa801561027457826002916001965f91610247575b501691836101f28689610766565b51165f52858152885f20937fffffffffffffffffffffffff00000000000000000000000000000000000000009484868254161790556102318689610766565b5116925f5252865f209182541617905501610173565b6102679150843d861161026d575b61025f81836105b2565b8101906107a7565b5f6101e4565b503d610255565b87513d5f823e3d90fd5b005b5034610155579061029036610620565b916102996107d3565b5f925b805184101561027e5773ffffffffffffffffffffffffffffffffffffffff93846102c68284610766565b511694835180967fc55dae63000000000000000000000000000000000000000000000000000000008252818760209384935afa908115610386576001949596975f92610366575b50826002929361031d8689610766565b51165f52858252875f20937fffffffffffffffffffffffff000000000000000000000000000000000000000094858154169055165f5252845f209081541690550192919061029c565b6002925061038090823d841161026d5761025f81836105b2565b9161030d565b85513d5f823e3d90fd5b5034610155575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555760209073ffffffffffffffffffffffffffffffffffffffff5f54169051908152f35b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261015557359073ffffffffffffffffffffffffffffffffffffffff808316809303610155576020925f5260028352815f2054169051908152f35b34610155575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555761047e6107d3565b5f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261015557359073ffffffffffffffffffffffffffffffffffffffff808316809303610155576020925f5260018352815f2054169051908152f35b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610155573573ffffffffffffffffffffffffffffffffffffffff908181168103610155576105a3906106de565b90918351921682526020820152f35b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176105f357604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101555767ffffffffffffffff9160043583811161015557816023820112156101555780600401359384116105f3578360051b906040519461068c60208401876105b2565b85526024602086019282010192831161015557602401905b8282106106b2575050505090565b813573ffffffffffffffffffffffffffffffffffffffff811681036101555781529083019083016106a4565b73ffffffffffffffffffffffffffffffffffffffff8091165f5260016020528060405f20541690600260205260405f2054168115155f14610727575090670de0b6b3a764000090565b9050801561073c5790670de0b6b3a764000090565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b805182101561077a5760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b90816020910312610155575173ffffffffffffffffffffffffffffffffffffffff811681036101555790565b73ffffffffffffffffffffffffffffffffffffffff5f541633036107f357565b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fdfea2646970667358221220167daea3dd83dfba39588d5d4b7d4f5566382c6e12fce77f2ea70258ee18bc7b64736f6c63430008170033", + "deployedBytecode": "0x60406080815260049081361015610014575f80fd5b5f3560e01c8063023276f01461054957806346bfac4a146104e2578063715018a6146104485780637d683561146103e15780638da5cb5b14610390578063bfef7bdf14610280578063da40385d146101595763f2fde38b14610074575f80fd5b346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555781359173ffffffffffffffffffffffffffffffffffffffff91828416809403610155576100ce6107d3565b83156101265750505f54827fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b905f60249251917f1e4fbdf7000000000000000000000000000000000000000000000000000000008352820152fd5b5f80fd5b5090346101555761016936610620565b6101716107d3565b5f5b815181101561027e5773ffffffffffffffffffffffffffffffffffffffff908161019d8285610766565b511691855180937fc55dae63000000000000000000000000000000000000000000000000000000008252818760209384935afa801561027457826002916001965f91610247575b501691836101f28689610766565b51165f52858152885f20937fffffffffffffffffffffffff00000000000000000000000000000000000000009484868254161790556102318689610766565b5116925f5252865f209182541617905501610173565b6102679150843d861161026d575b61025f81836105b2565b8101906107a7565b5f6101e4565b503d610255565b87513d5f823e3d90fd5b005b5034610155579061029036610620565b916102996107d3565b5f925b805184101561027e5773ffffffffffffffffffffffffffffffffffffffff93846102c68284610766565b511694835180967fc55dae63000000000000000000000000000000000000000000000000000000008252818760209384935afa908115610386576001949596975f92610366575b50826002929361031d8689610766565b51165f52858252875f20937fffffffffffffffffffffffff000000000000000000000000000000000000000094858154169055165f5252845f209081541690550192919061029c565b6002925061038090823d841161026d5761025f81836105b2565b9161030d565b85513d5f823e3d90fd5b5034610155575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555760209073ffffffffffffffffffffffffffffffffffffffff5f54169051908152f35b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261015557359073ffffffffffffffffffffffffffffffffffffffff808316809303610155576020925f5260028352815f2054169051908152f35b34610155575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101555761047e6107d3565b5f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261015557359073ffffffffffffffffffffffffffffffffffffffff808316809303610155576020925f5260018352815f2054169051908152f35b5090346101555760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610155573573ffffffffffffffffffffffffffffffffffffffff908181168103610155576105a3906106de565b90918351921682526020820152f35b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176105f357604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101555767ffffffffffffffff9160043583811161015557816023820112156101555780600401359384116105f3578360051b906040519461068c60208401876105b2565b85526024602086019282010192831161015557602401905b8282106106b2575050505090565b813573ffffffffffffffffffffffffffffffffffffffff811681036101555781529083019083016106a4565b73ffffffffffffffffffffffffffffffffffffffff8091165f5260016020528060405f20541690600260205260405f2054168115155f14610727575090670de0b6b3a764000090565b9050801561073c5790670de0b6b3a764000090565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b805182101561077a5760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b90816020910312610155575173ffffffffffffffffffffffffffffffffffffffff811681036101555790565b73ffffffffffffffffffffffffffffffffffffffff5f541633036107f357565b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fdfea2646970667358221220167daea3dd83dfba39588d5d4b7d4f5566382c6e12fce77f2ea70258ee18bc7b64736f6c63430008170033", + "devdoc": { + "errors": { + "OwnableInvalidOwner(address)": [ + { + "details": "The owner is not a valid owner account. (eg. `address(0)`)" + } + ], + "OwnableUnauthorizedAccount(address)": [ + { + "details": "The caller account is not authorized to perform an operation." + } + ] + }, + "kind": "dev", + "methods": { + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 8, + "contract": "contracts/wrappers/CompoundV3Wrapper.sol:CompoundV3Wrapper", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 313, + "contract": "contracts/wrappers/CompoundV3Wrapper.sol:CompoundV3Wrapper", + "label": "cTokenToToken", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_contract(IERC20)225,t_contract(IERC20)225)" + }, + { + "astId": 319, + "contract": "contracts/wrappers/CompoundV3Wrapper.sol:CompoundV3Wrapper", + "label": "tokenTocToken", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_contract(IERC20)225,t_contract(IERC20)225)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_contract(IERC20)225": { + "encoding": "inplace", + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_contract(IERC20)225,t_contract(IERC20)225)": { + "encoding": "mapping", + "key": "t_contract(IERC20)225", + "label": "mapping(contract IERC20 => contract IERC20)", + "numberOfBytes": "32", + "value": "t_contract(IERC20)225" + } + } + } +} \ No newline at end of file