From e0116ac799331f5af1ab52230535ecc21776ced3 Mon Sep 17 00:00:00 2001 From: aalavandhan1984 <6264334+aalavandhan@users.noreply.github.com> Date: Wed, 24 May 2023 09:39:33 -0400 Subject: [PATCH] deployed rollover vault to mainnet --- spot-contracts/.openzeppelin/mainnet.json | 266 ++++++++++++++++++++++ spot-contracts/README.md | 1 + spot-contracts/hardhat.config.ts | 2 +- spot-contracts/tasks/mainnet.sh | 15 ++ 4 files changed, 283 insertions(+), 1 deletion(-) diff --git a/spot-contracts/.openzeppelin/mainnet.json b/spot-contracts/.openzeppelin/mainnet.json index 5a90f021..17608cc9 100644 --- a/spot-contracts/.openzeppelin/mainnet.json +++ b/spot-contracts/.openzeppelin/mainnet.json @@ -9,6 +9,11 @@ "address": "0xC1f33e0cf7e40a67375007104B929E49a581bafE", "txHash": "0x0b98db5773264dcf6c836e9b077cd17b633dfb5dabfbb7f7cbaaf5be0b513412", "kind": "transparent" + }, + { + "address": "0x82A91a0D599A45d8E9Af781D67f695d7C72869Bd", + "txHash": "0xc5b2302ca23f26fa26327bb3abb36827ca282cd20f0e571bd9cede84e6b5d329", + "kind": "transparent" } ], "impls": { @@ -781,6 +786,267 @@ } } } + }, + "df6c2a5c1fbf7eab6eed2fda5220dd9af8c5a07f0a7efb7e1504c23970882fd0": { + "address": "0x640Eb153c954a031E9bb9DAC197a7eCe0B54F1e8", + "txHash": "0xa04b33c448f8ed6c37f4fd0961f6aeebcb86bebd79a1b2a8f0a81b963fec94c2", + "layout": { + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_balances", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_address,t_uint256)", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:37" + }, + { + "label": "_allowances", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:39" + }, + { + "label": "_totalSupply", + "offset": 0, + "slot": "53", + "type": "t_uint256", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:41" + }, + { + "label": "_name", + "offset": 0, + "slot": "54", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:43" + }, + { + "label": "_symbol", + "offset": 0, + "slot": "55", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:44" + }, + { + "label": "__gap", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)45_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:394" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC20BurnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol:51" + }, + { + "label": "_owner", + "offset": 0, + "slot": "151", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "152", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_paused", + "offset": 0, + "slot": "201", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "_status", + "offset": 0, + "slot": "251", + "type": "t_uint256", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:38" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:74" + }, + { + "label": "underlying", + "offset": 0, + "slot": "301", + "type": "t_contract(IERC20Upgradeable)1157", + "contract": "RolloverVault", + "src": "contracts/vaults/RolloverVault.sol:87" + }, + { + "label": "_deployed", + "offset": 0, + "slot": "302", + "type": "t_struct(AddressSet)4620_storage", + "contract": "RolloverVault", + "src": "contracts/vaults/RolloverVault.sol:91" + }, + { + "label": "minDeploymentAmt", + "offset": 0, + "slot": "304", + "type": "t_uint256", + "contract": "RolloverVault", + "src": "contracts/vaults/RolloverVault.sol:99" + }, + { + "label": "perp", + "offset": 0, + "slot": "305", + "type": "t_contract(IPerpetualTranche)8314", + "contract": "RolloverVault", + "src": "contracts/vaults/RolloverVault.sol:102" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IERC20Upgradeable)1157": { + "label": "contract IERC20Upgradeable", + "numberOfBytes": "20" + }, + "t_contract(IPerpetualTranche)8314": { + "label": "contract IPerpetualTranche", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_uint256)": { + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(AddressSet)4620_storage": { + "label": "struct EnumerableSetUpgradeable.AddressSet", + "members": [ + { + "label": "_inner", + "type": "t_struct(Set)4319_storage", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)4319_storage": { + "label": "struct EnumerableSetUpgradeable.Set", + "members": [ + { + "label": "_values", + "type": "t_array(t_bytes32)dyn_storage", + "offset": 0, + "slot": "0" + }, + { + "label": "_indexes", + "type": "t_mapping(t_bytes32,t_uint256)", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } diff --git a/spot-contracts/README.md b/spot-contracts/README.md index 494de596..cb322daf 100644 --- a/spot-contracts/README.md +++ b/spot-contracts/README.md @@ -7,6 +7,7 @@ The official mainnet addresses are: - SPOT ERC-20 Token: [0xC1f33e0cf7e40a67375007104B929E49a581bafE](https://etherscan.io/address/0xC1f33e0cf7e40a67375007104B929E49a581bafE) - Bond issuer: [0x85d1BA777Eb3FCBb10C82cdf3aAa8231e21B6777](https://etherscan.io/address/0x85d1BA777Eb3FCBb10C82cdf3aAa8231e21B6777) - Router: [0x38f600e08540178719BF656e6B43FC15A529c393](https://etherscan.io/address/0x38f600e08540178719BF656e6B43FC15A529c393) +- RolloverVault: [0x82A91a0D599A45d8E9Af781D67f695d7C72869Bd](https://etherscan.io//address/0x82A91a0D599A45d8E9Af781D67f695d7C72869Bd) ## Install diff --git a/spot-contracts/hardhat.config.ts b/spot-contracts/hardhat.config.ts index 143dfa48..bc81681c 100644 --- a/spot-contracts/hardhat.config.ts +++ b/spot-contracts/hardhat.config.ts @@ -43,7 +43,7 @@ export default { accounts: { mnemonic: process.env.PROD_MNEMONIC || Wallet.createRandom().mnemonic.phrase, }, - gasMultiplier: 1.01, + gasMultiplier: 1.005, }, }, solidity: { diff --git a/spot-contracts/tasks/mainnet.sh b/spot-contracts/tasks/mainnet.sh index 49a49149..332c51c5 100644 --- a/spot-contracts/tasks/mainnet.sh +++ b/spot-contracts/tasks/mainnet.sh @@ -32,6 +32,11 @@ yarn hardhat --network mainnet deploy:DiscountStrategy:computeDiscountHash \ --tranche-index "0" \ --tranche-discount "1.0" +yarn hardhat --network mainnet deploy:RolloverVault \ + --name "Rollover Vault Note (SPOT)" \ + --symbol "RV-NOTE-SPOT" \ + --perp-address "0xC1f33e0cf7e40a67375007104B929E49a581bafE" + ######################################################################## ## Transfer ownership yarn hardhat --network mainnet transferOwnership "0x85d1BA777Eb3FCBb10C82cdf3aAa8231e21B6777" \ @@ -49,6 +54,9 @@ yarn hardhat --network mainnet transferOwnership "0xC1f33e0cf7e40a67375007104B92 yarn hardhat --network mainnet transferOwnership "0x2978B4103985A6668CE345555b0febdE64Fb092F" \ --new-owner-address "0x57981B1EaFe4b18EC97f8B10859B40207b364662" +yarn hardhat --network mainnet transferOwnership "0x82A91a0D599A45d8E9Af781D67f695d7C72869Bd" \ + --new-owner-address "0x57981B1EaFe4b18EC97f8B10859B40207b364662" + ######################################################################## ## OPS yarn hardhat --network mainnet ops:perp:info 0xC1f33e0cf7e40a67375007104B929E49a581bafE @@ -92,6 +100,13 @@ yarn hardhat --network mainnet ops:trancheAndRollover \ --perp-address 0xC1f33e0cf7e40a67375007104B929E49a581bafE \ --collateral-amount 200 + +yarn hardhat --network mainnet ops:vault:info 0x82A91a0D599A45d8E9Af781D67f695d7C72869Bd + +yarn hardhat --network mainnet ops:vault:deposit \ + --vault-address 0x82A91a0D599A45d8E9Af781D67f695d7C72869Bd \ + --underlying-amount 2 + ######################################################################## ## upgrade