Skip to content

Commit

Permalink
upgrade tasks
Browse files Browse the repository at this point in the history
Signed-off-by: aalavandhann <[email protected]>
  • Loading branch information
aalavandhan committed Apr 16, 2024
1 parent 2ec9e26 commit c353cd6
Show file tree
Hide file tree
Showing 13 changed files with 360 additions and 142 deletions.
220 changes: 205 additions & 15 deletions spot-contracts/.openzeppelin/sepolia.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
"address": "0x107614c6602A8e602952Da107B8fE62b5Ab13b04",
"txHash": "0xda9cf80585a7da2935caa35a5dde76c35cf1e7a24bd0b4754e20a7a9eed275b1",
"kind": "transparent"
},
{
"address": "0x3205ade922457db878039fDbF0e5A88872027A67",
"txHash": "0x19de9d6b4d49a8bb03deef871232212e6c696942feb6476c98ad7a8017e0975b",
"kind": "transparent"
}
],
"impls": {
Expand Down Expand Up @@ -364,119 +369,119 @@
"slot": "302",
"type": "t_contract(IFeePolicy)11421",
"contract": "PerpetualTranche",
"src": "contracts/PerpetualTranche.sol:130"
"src": "contracts/PerpetualTranche.sol:131"
},
{
"label": "_pricingStrategy_DEPRECATED",
"offset": 0,
"slot": "303",
"type": "t_address",
"contract": "PerpetualTranche",
"src": "contracts/PerpetualTranche.sol:135"
"src": "contracts/PerpetualTranche.sol:137"
},
{
"label": "_discountStrategy_DEPRECATED",
"offset": 0,
"slot": "304",
"type": "t_address",
"contract": "PerpetualTranche",
"src": "contracts/PerpetualTranche.sol:142"
"src": "contracts/PerpetualTranche.sol:145"
},
{
"label": "bondIssuer",
"offset": 0,
"slot": "305",
"type": "t_contract(IBondIssuer)11341",
"contract": "PerpetualTranche",
"src": "contracts/PerpetualTranche.sol:146"
"src": "contracts/PerpetualTranche.sol:149"
},
{
"label": "_depositBond",
"offset": 0,
"slot": "306",
"type": "t_contract(IBondController)11968",
"contract": "PerpetualTranche",
"src": "contracts/PerpetualTranche.sol:149"
"src": "contracts/PerpetualTranche.sol:152"
},
{
"label": "minTrancheMaturitySec",
"offset": 0,
"slot": "307",
"type": "t_uint256",
"contract": "PerpetualTranche",
"src": "contracts/PerpetualTranche.sol:153"
"src": "contracts/PerpetualTranche.sol:156"
},
{
"label": "maxTrancheMaturitySec",
"offset": 0,
"slot": "308",
"type": "t_uint256",
"contract": "PerpetualTranche",
"src": "contracts/PerpetualTranche.sol:157"
"src": "contracts/PerpetualTranche.sol:160"
},
{
"label": "_matureValueTargetPerc_DEPRECATED",
"offset": 0,
"slot": "309",
"type": "t_uint256",
"contract": "PerpetualTranche",
"src": "contracts/PerpetualTranche.sol:164"
"src": "contracts/PerpetualTranche.sol:168"
},
{
"label": "maxSupply",
"offset": 0,
"slot": "310",
"type": "t_uint256",
"contract": "PerpetualTranche",
"src": "contracts/PerpetualTranche.sol:167"
"src": "contracts/PerpetualTranche.sol:171"
},
{
"label": "maxMintAmtPerTranche",
"offset": 0,
"slot": "311",
"type": "t_uint256",
"contract": "PerpetualTranche",
"src": "contracts/PerpetualTranche.sol:170"
"src": "contracts/PerpetualTranche.sol:174"
},
{
"label": "mintedSupplyPerTranche",
"offset": 0,
"slot": "312",
"type": "t_mapping(t_contract(ITranche)11995,t_uint256)",
"contract": "PerpetualTranche",
"src": "contracts/PerpetualTranche.sol:173"
"src": "contracts/PerpetualTranche.sol:177"
},
{
"label": "_appliedDiscounts_DEPRECATED",
"offset": 0,
"slot": "313",
"type": "t_mapping(t_contract(IERC20Upgradeable)1205,t_uint256)",
"contract": "PerpetualTranche",
"src": "contracts/PerpetualTranche.sol:179"
"src": "contracts/PerpetualTranche.sol:184"
},
{
"label": "_reserves",
"offset": 0,
"slot": "314",
"type": "t_struct(AddressSet)4926_storage",
"contract": "PerpetualTranche",
"src": "contracts/PerpetualTranche.sol:185"
"src": "contracts/PerpetualTranche.sol:190"
},
{
"label": "_matureTrancheBalance_DEPRECATED",
"offset": 0,
"slot": "316",
"type": "t_uint256",
"contract": "PerpetualTranche",
"src": "contracts/PerpetualTranche.sol:191"
"src": "contracts/PerpetualTranche.sol:196"
},
{
"label": "vault",
"offset": 0,
"slot": "317",
"type": "t_contract(IRolloverVault)11692",
"contract": "PerpetualTranche",
"src": "contracts/PerpetualTranche.sol:199"
"src": "contracts/PerpetualTranche.sol:204"
}
],
"types": {
Expand Down Expand Up @@ -896,6 +901,191 @@
},
"namespaces": {}
}
},
"2546bfa1b5a5142a0d95cea7e7372f3a735712bf05bbaab3a7df09b1022fb6ee": {
"address": "0x1c611ab4D40781781d564e3efb8ACEBC23884942",
"txHash": "0x6ad9a6f0b7b0a7c2189815c55bcfd2e7781b0ec1c95e5226be19930ed0d7865b",
"layout": {
"solcVersion": "0.8.20",
"storage": [
{
"label": "_initialized",
"offset": 0,
"slot": "0",
"type": "t_uint8",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63",
"retypedFrom": "bool"
},
{
"label": "_initializing",
"offset": 1,
"slot": "0",
"type": "t_bool",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68"
},
{
"label": "__gap",
"offset": 0,
"slot": "1",
"type": "t_array(t_uint256)50_storage",
"contract": "ContextUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40"
},
{
"label": "_owner",
"offset": 0,
"slot": "51",
"type": "t_address",
"contract": "OwnableUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22"
},
{
"label": "__gap",
"offset": 0,
"slot": "52",
"type": "t_array(t_uint256)49_storage",
"contract": "OwnableUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94"
},
{
"label": "targetSubscriptionRatio",
"offset": 0,
"slot": "101",
"type": "t_uint256",
"contract": "FeePolicy",
"src": "contracts/FeePolicy.sol:84"
},
{
"label": "deviationRatioBoundLower",
"offset": 0,
"slot": "102",
"type": "t_uint256",
"contract": "FeePolicy",
"src": "contracts/FeePolicy.sol:87"
},
{
"label": "deviationRatioBoundUpper",
"offset": 0,
"slot": "103",
"type": "t_uint256",
"contract": "FeePolicy",
"src": "contracts/FeePolicy.sol:90"
},
{
"label": "perpMintFeePerc",
"offset": 0,
"slot": "104",
"type": "t_uint256",
"contract": "FeePolicy",
"src": "contracts/FeePolicy.sol:98"
},
{
"label": "perpBurnFeePerc",
"offset": 0,
"slot": "105",
"type": "t_uint256",
"contract": "FeePolicy",
"src": "contracts/FeePolicy.sol:101"
},
{
"label": "perpRolloverFee",
"offset": 0,
"slot": "106",
"type": "t_struct(RolloverFeeSigmoidParams)5764_storage",
"contract": "FeePolicy",
"src": "contracts/FeePolicy.sol:113"
},
{
"label": "vaultMintFeePerc",
"offset": 0,
"slot": "109",
"type": "t_uint256",
"contract": "FeePolicy",
"src": "contracts/FeePolicy.sol:121"
},
{
"label": "vaultBurnFeePerc",
"offset": 0,
"slot": "110",
"type": "t_uint256",
"contract": "FeePolicy",
"src": "contracts/FeePolicy.sol:124"
},
{
"label": "vaultUnderlyingToPerpSwapFeePerc",
"offset": 0,
"slot": "111",
"type": "t_uint256",
"contract": "FeePolicy",
"src": "contracts/FeePolicy.sol:127"
},
{
"label": "vaultPerpToUnderlyingSwapFeePerc",
"offset": 0,
"slot": "112",
"type": "t_uint256",
"contract": "FeePolicy",
"src": "contracts/FeePolicy.sol:130"
}
],
"types": {
"t_address": {
"label": "address",
"numberOfBytes": "20"
},
"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_int256": {
"label": "int256",
"numberOfBytes": "32"
},
"t_struct(RolloverFeeSigmoidParams)5764_storage": {
"label": "struct FeePolicy.RolloverFeeSigmoidParams",
"members": [
{
"label": "lower",
"type": "t_int256",
"offset": 0,
"slot": "0"
},
{
"label": "upper",
"type": "t_int256",
"offset": 0,
"slot": "1"
},
{
"label": "growth",
"type": "t_int256",
"offset": 0,
"slot": "2"
}
],
"numberOfBytes": "96"
},
"t_uint256": {
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint8": {
"label": "uint8",
"numberOfBytes": "1"
}
},
"namespaces": {}
}
}
}
}
2 changes: 1 addition & 1 deletion spot-contracts/.solcover.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
skipFiles: ["test", "_interfaces", "_external"],
skipFiles: ["_test", "_interfaces", "_external"],
};
1 change: 1 addition & 0 deletions spot-contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ There is a testnet deployment on Sepolia.
- Bond issuer: [0x3838C8d4D092d40Cb27DD22Dafc6E1A81ea2DB60](https://sepolia.etherscan.io//address/0x3838C8d4D092d40Cb27DD22Dafc6E1A81ea2DB60)
- Router: [0x5B59915E5754C62C40Ba5e7467382ced958F8559](https://sepolia.etherscan.io//address/0x5B59915E5754C62C40Ba5e7467382ced958F8559)
- RolloverVault: [0x107614c6602A8e602952Da107B8fE62b5Ab13b04](https://sepolia.etherscan.io//address/0x107614c6602A8e602952Da107B8fE62b5Ab13b04)
- FeePolicy: [0x2DdF288F26490D1147296cC0FA2B3c4da5E15f10](https://sepolia.etherscan.io//address/0x2DdF288F26490D1147296cC0FA2B3c4da5E15f10)

## Contribute

Expand Down
26 changes: 25 additions & 1 deletion spot-contracts/tasks/deploy/perp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ task("deploy:Router")
const RouterV2 = await hre.ethers.getContractFactory("RouterV2");
const router = await RouterV2.deploy();
await router.deployed();
console.log("router", router.address);
console.log("RouterV2", router.address);

if (args.verify) {
await sleep(30);
Expand All @@ -141,3 +141,27 @@ task("deploy:Router")
console.log("Skipping verification");
}
});

task("deploy:FeePolicy")
.addParam("verify", "flag to set false for local deployments", true, types.boolean)
.setAction(async function (args: TaskArguments, hre) {
const deployer = (await hre.ethers.getSigners())[0];
console.log("Signer", await deployer.getAddress());

const FeePolicy = await hre.ethers.getContractFactory("FeePolicy");
const feePolicy = await hre.upgrades.deployProxy(FeePolicy.connect(deployer));
await feePolicy.deployed();
console.log("feePolicy", feePolicy.address);

if (args.verify) {
await sleep(30);
await hre.run("verify:contract", {
address: feePolicy.address,
});
await hre.run("verify:contract", {
address: await getImplementationAddress(hre.ethers.provider, feePolicy.address),
});
} else {
console.log("Skipping verification");
}
});
Loading

0 comments on commit c353cd6

Please sign in to comment.