From f2a985d447e7d4ffef2de72a2476d05adc8844ab Mon Sep 17 00:00:00 2001 From: xavikh Date: Tue, 10 Dec 2024 10:43:55 +0100 Subject: [PATCH] Set Onix vars --- Makefile | 29 ++++++++++++++++++++-- script/multisig-members.json | 7 +++++- src/libs/CurveConstantLib.sol | 6 ++--- test/escrow/curve/QuadraticCurveMath.t.sol | 14 +++++------ 4 files changed, 43 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 9e9db1b..c3d3962 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,33 @@ ft-sepolia-fork :; forge test --match-contract TestE2EV2 \ deploy-preview-mode-sepolia :; forge script script/Deploy.s.sol:Deploy \ --rpc-url https://sepolia.mode.network \ --private-key $(DEPLOYMENT_PRIVATE_KEY) \ - -vvvvv + -vvvvv + +deploy-preview-sepolia :; forge script script/Deploy.s.sol:Deploy \ + --rpc-url https://eth-sepolia.g.alchemy.com/v2/KqUmJvu1tiJqOdy6lopFGzVa5MfPVn2J \ + --private-key $(DEPLOYMENT_PRIVATE_KEY) \ + -vvvvv + +deploy-preview-holesky :; forge script script/Deploy.s.sol:Deploy \ + --rpc-url https://eth-holesky.g.alchemy.com/v2/KqUmJvu1tiJqOdy6lopFGzVa5MfPVn2J \ + --private-key $(DEPLOYMENT_PRIVATE_KEY) \ + -vvvvv + +deploy-holesky :; forge script script/Deploy.s.sol:Deploy \ + --rpc-url https://eth-holesky.g.alchemy.com/v2/KqUmJvu1tiJqOdy6lopFGzVa5MfPVn2J \ + --private-key $(DEPLOYMENT_PRIVATE_KEY) \ + --broadcast \ + --verify \ + --etherscan-api-key $(ETHERSCAN_API_KEY) \ + -vvvvv + +deploy-sepolia :; forge script script/Deploy.s.sol:Deploy \ + --rpc-url https://eth-sepolia.g.alchemy.com/v2/KqUmJvu1tiJqOdy6lopFGzVa5MfPVn2J \ + --private-key $(DEPLOYMENT_PRIVATE_KEY) \ + --broadcast \ + --verify \ + --etherscan-api-key $(ETHERSCAN_API_KEY) \ + -vvvvv deploy-mode-sepolia :; forge script script/Deploy.s.sol:Deploy \ --rpc-url https://sepolia.mode.network \ @@ -68,4 +94,3 @@ deploy-preview-mode :; forge script script/Deploy.s.sol:Deploy \ --verifier blockscout \ --verifier-url https://explorer.mode.network/api\? \ -vvv - diff --git a/script/multisig-members.json b/script/multisig-members.json index eae9e52..f956c87 100644 --- a/script/multisig-members.json +++ b/script/multisig-members.json @@ -1,3 +1,8 @@ { - "members": ["0x7771c1510509C0dA515BDD12a57dbDd8C58E5363"] + "members": [ + "0x35911Cc89aaBe7Af6726046823D5b678B6A1498d", + "0x2A4a8ab4B34D588AAF7504f398203C05CD124Dda", + "0x249eD03175f3C86c1A7efa40cFa1f5e75d902a42", + "0x80058a30B84F339beFb7ABcB25B1412ff0f88Ec3" + ] } diff --git a/src/libs/CurveConstantLib.sol b/src/libs/CurveConstantLib.sol index 9f4fbde..5ec84d4 100644 --- a/src/libs/CurveConstantLib.sol +++ b/src/libs/CurveConstantLib.sol @@ -13,10 +13,10 @@ pragma solidity ^0.8.0; library CurveConstantLib { int256 internal constant SHARED_CONSTANT_COEFFICIENT = 1e18; /// @dev 2 / (7 * 2_weeks) - expressed in fixed point - int256 internal constant SHARED_LINEAR_COEFFICIENT = 236205593348; + int256 internal constant SHARED_LINEAR_COEFFICIENT = 482253086419; /// @dev 1 / (7 * (2_weeks)^2) - expressed in fixed point - int256 internal constant SHARED_QUADRATIC_COEFFICIENT = 97637; + int256 internal constant SHARED_QUADRATIC_COEFFICIENT = 0; /// @dev the maxiumum number of epochs the cure can keep increasing - uint256 internal constant MAX_EPOCHS = 5; + uint256 internal constant MAX_EPOCHS = 12; } diff --git a/test/escrow/curve/QuadraticCurveMath.t.sol b/test/escrow/curve/QuadraticCurveMath.t.sol index 93711bb..14456a0 100644 --- a/test/escrow/curve/QuadraticCurveMath.t.sol +++ b/test/escrow/curve/QuadraticCurveMath.t.sol @@ -108,7 +108,7 @@ contract TestQuadraticIncreasingCurve is QuadraticCurveBase { // solmate (optimized): 449.206254284606635135 assertEq( curve.votingPowerAt(tokenIdFirst, block.timestamp), - 449206254284606635135, + 473276452878968806921, "Balance incorrect after warmup" ); assertEq(curve.isWarm(tokenIdFirst), true, "Still warming up"); @@ -117,7 +117,7 @@ contract TestQuadraticIncreasingCurve is QuadraticCurveBase { // solmate: 1067784483312193385000000000 assertEq( curve.votingPowerAt(tokenIdSecond, block.timestamp), - 1067784483312193385000000000, + 1125000482252891219000000000, "Balance incorrect after warmup II" ); @@ -130,17 +130,17 @@ contract TestQuadraticIncreasingCurve is QuadraticCurveBase { // solmate2: 600.985163959347101952 assertEq( curve.votingPowerAt(tokenIdFirst, block.timestamp), - 600985163959347101952, + 666092499999616779456, "Balance incorrect after p1" ); - uint256 expectedMaxI = 2524126241845405205760; - uint256 expectedMaxII = 5999967296216704000000000000; + uint256 expectedMaxI = 3365519999995401353472; + uint256 expectedMaxII = 7999999999989068800000000000; // warp to the final period - // TECHNICALLY, this should finish at exactly 5 periodd and 6 * voting power + // TECHNICALLY, this should finish at exactly 5 periods and 6 * voting power // but FP arithmetic has a small rounding error - vm.warp(start + clock.epochDuration() * 5); + vm.warp(start + clock.epochDuration() * 12); assertEq( curve.votingPowerAt(tokenIdFirst, block.timestamp), expectedMaxI,