Skip to content

Commit

Permalink
deployed rollover vault to mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
aalavandhan committed May 24, 2023
1 parent aa6e68a commit e0116ac
Show file tree
Hide file tree
Showing 4 changed files with 283 additions and 1 deletion.
266 changes: 266 additions & 0 deletions spot-contracts/.openzeppelin/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
"address": "0xC1f33e0cf7e40a67375007104B929E49a581bafE",
"txHash": "0x0b98db5773264dcf6c836e9b077cd17b633dfb5dabfbb7f7cbaaf5be0b513412",
"kind": "transparent"
},
{
"address": "0x82A91a0D599A45d8E9Af781D67f695d7C72869Bd",
"txHash": "0xc5b2302ca23f26fa26327bb3abb36827ca282cd20f0e571bd9cede84e6b5d329",
"kind": "transparent"
}
],
"impls": {
Expand Down Expand Up @@ -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"
}
}
}
}
}
}
1 change: 1 addition & 0 deletions spot-contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion spot-contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default {
accounts: {
mnemonic: process.env.PROD_MNEMONIC || Wallet.createRandom().mnemonic.phrase,
},
gasMultiplier: 1.01,
gasMultiplier: 1.005,
},
},
solidity: {
Expand Down
15 changes: 15 additions & 0 deletions spot-contracts/tasks/mainnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit e0116ac

Please sign in to comment.