diff --git a/README.md b/README.md index b3523fa..90da609 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,6 @@ You will see an output like this: Proxy deployed: 0x7A0b7e6D24eDe78260c9ddBD98e828B0e11A8EA2 Implementation deployed: 0x7C623e01c5ce2e313C223ef2aEc1Ae5C6d12D9DD Owner is 0x15fc323DFE5D5DCfbeEdc25CEcbf57f676634d77 - New implementation deployed: 0xFf6d41b0567d7368e60B064F4dCbd6681cBC31A7 Upgraded to version: 0.3.0 ``` @@ -70,7 +69,7 @@ The output will look like this: Upgrading from version: 0.3.0 Owner is 0x15fc323DFE5D5DCfbeEdc25CEcbf57f676634d77 New implementation deployed: 0x64Fa96a67910956141cc481a43f242C045c10165 - Upgraded to version: 0.3.3 + Upgraded to version: 0.3.4 ``` If you want to check the current version your contract was upgraded to, run @@ -90,7 +89,7 @@ forge script script/Configure.s.sol --broadcast --legacy --sig "commissionRate(a The output will contain the following information: ``` - Running version: 0.3.3 + Running version: 0.3.4 Commission rate: 0.0% New commission rate: 10.0% ``` @@ -117,7 +116,7 @@ forge script script/Configure.s.sol --broadcast --legacy --sig "commissionReceiv The output will contain the following information: ``` - Running version: 0.3.3 + Running version: 0.3.4 Commission receiver: 0x15fc323DFE5D5DCfbeEdc25CEcbf57f676634d77 New commission receiver: 0xeA78aAE5Be606D2D152F00760662ac321aB8F017 ``` @@ -208,7 +207,7 @@ with the private key of delegator account. It's important to make sure the accou The output will look like this for liquid staking: ``` - Running version: 0.3.3 + Running version: 0.3.4 Current stake: 10000000000000000000000000 wei Current rewards: 110314207650273223687 wei LST address: 0x9e5c257D1c6dF74EaA54e58CdccaCb924669dc83 @@ -217,7 +216,7 @@ The output will look like this for liquid staking: ``` and like this for the non-liquid variant: ``` - Running version: 0.3.3 + Running version: 0.3.4 Current stake: 10000000000000000000000000 wei Current rewards: 110314207650273223687 wei Staker balance before: 99899145245801454561224 wei @@ -244,7 +243,7 @@ using the private key of an account that holds some LST in case of the liquid va The output will look like this for liquid staking: ``` - Running version: 0.3.3 + Running version: 0.3.4 Current stake: 10000000000000000000000000 wei Current rewards: 331912568306010928520 wei LST address: 0x9e5c257D1c6dF74EaA54e58CdccaCb924669dc83 @@ -253,7 +252,7 @@ The output will look like this for liquid staking: ``` and like this for the non-liquid variant: ``` - Running version: 0.3.3 + Running version: 0.3.4 Current stake: 10000000000000000000000000 wei Current rewards: 331912568306010928520 wei Staker balance before: 99698814298179759361224 wei @@ -268,7 +267,7 @@ with the private key of the account that unstaked in the previous step. The output will look like this: ``` - Running version: 0.3.3 + Running version: 0.3.4 Staker balance before: 99698086421983460161224 wei Staker balance after: 99798095485861371162343 wei ``` @@ -321,10 +320,12 @@ Staking pool operators are encouraged to fork and adapt the above contracts to i The tests included in this repository should also be adjusted and extended accordingly. They can be executed by running ```bash +unset FOUNDRY_ETH_RPC_URL forge test ``` or ```bash +unset FOUNDRY_ETH_RPC_URL forge test -vv ``` if you want to see the values calculated in the tests. diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index a2b1b05..41de8bf 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -96,6 +96,16 @@ contract Deploy is Script { delegation.owner() ); + bytes memory reinitializerCall = abi.encodeWithSignature( + "reinitialize(uint64)", + 1 + ); + + delegation.upgradeToAndCall( + implementation, + reinitializerCall + ); + (uint24 major, uint24 minor, uint24 patch) = delegation.decodedVersion(); console.log("Upgraded to version: %s.%s.%s", uint256(major), diff --git a/src/BaseDelegation.sol b/src/BaseDelegation.sol index af1cad7..5d4056e 100644 --- a/src/BaseDelegation.sol +++ b/src/BaseDelegation.sol @@ -57,7 +57,7 @@ abstract contract BaseDelegation is IDelegation, PausableUpgradeable, Ownable2St // contract file names remain the same across all versions // so that the upgrade script does not need to be modified // to import the new version each time there is one - uint64 internal immutable VERSION = encodeVersion(0, 3, 3); + uint64 internal immutable VERSION = encodeVersion(0, 3, 4); function version() public view returns(uint64) { return _getInitializedVersion(); diff --git a/src/LiquidDelegation.sol b/src/LiquidDelegation.sol index afaeb1a..4f80e6d 100644 --- a/src/LiquidDelegation.sol +++ b/src/LiquidDelegation.sol @@ -43,7 +43,6 @@ contract LiquidDelegation is BaseDelegation, ILiquidDelegation { __BaseDelegation_init(initialOwner); LiquidDelegationStorage storage $ = _getLiquidDelegationStorage(); $.lst = address(new NonRebasingLST(address(this), name, symbol)); - migrate(1); } // called when stake withdrawn from the deposit contract is claimed diff --git a/src/NonLiquidDelegation.sol b/src/NonLiquidDelegation.sol index 3c0b01f..25b4f99 100644 --- a/src/NonLiquidDelegation.sol +++ b/src/NonLiquidDelegation.sol @@ -77,7 +77,6 @@ contract NonLiquidDelegation is BaseDelegation, INonLiquidDelegation { function initialize(address initialOwner) public initializer { __BaseDelegation_init(initialOwner); - migrate(1); } // called when stake withdrawn from the deposit contract is claimed