celo-org / celo-monorepo

Official repository for core projects comprising the Celo platform
https://celo.org
Apache License 2.0
687 stars 362 forks source link

feat: add ReserveSpenderMultiSig to anvil migrations #11028

Closed arthurgousset closed 1 month ago

arthurgousset commented 1 month ago

Description

  1. adds ReserveSpenderMultiSig configs in migrationsConfig.json.
  2. proxies and deploys ReserveSpenderMultiSig.sol.
  3. sets ReserveSpenderMultiSig.sol as a spender on the Reserve contract.
  4. adds ReserveSpenderMultiSig.sol to the Registry.

Other changes

  1. adds empty ReserveSpenderMultiSig.t.sol test as a workaround to force foundry to compile the contract and adds its artifacts to the out/ directory.
  2. adds IReserveSpenderMultiSig to the HelperInterFaces.sol

Tested

Yes, locally.

Steps to reproduce tests locally 1. generate migrations and run anvil devchain (in separate terminal) 1. get address of `ReserveSpenderMultiSig` from `Registry` ✅ ```sh cast call \ "0x000000000000000000000000000000000000ce10" \ "getAddressForStringOrDie(string calldata identifier)(address)" \ "ReserveSpenderMultiSig" \ --rpc-url=http://127.0.0.1:8546 0x1A888D93eeAcF683c68E07Ad58Aa43f2A5742490 ``` 1. Check that the `ReserveSpenderMultiSig` address is in the `isSpender` mapping on the `Reserve` ✅ Context: ```sol mapping(address => bool) public isSpender; ``` Source: `mento-core/contracts/Reserve.sol` Get `Reserve` address from `Registry` ```sh cast call \ "0x000000000000000000000000000000000000ce10" \ "getAddressForStringOrDie(string calldata identifier)(address)" \ "Reserve" \ --rpc-url=http://127.0.0.1:8546 0x0a887500E327375378edF7b7d0E85F0378b8677a ``` ``` cast call \ "0x0a887500E327375378edF7b7d0E85F0378b8677a" \ "isSpender(address)(bool)" \ "0x1A888D93eeAcF683c68E07Ad58Aa43f2A5742490" \ --rpc-url=http://127.0.0.1:8546 true ```

Related issues

Backwards compatibility

Yes, backwards compatible. All existing features on the devchain are unchanged.

Documentation

Yes with detailed code comments.

arthurgousset commented 1 month ago

As of https://github.com/celo-org/celo-monorepo/pull/11028/commits/004bccc00245e7613da9e2888436d027528c2165 the ReserveSpenderMultiSig:

  1. is proxied and deployed
  2. is added as a spender to the Reserve contract
  3. is added to the Registry
Steps to reproduce tests locally 1. generate migrations and run anvil devchain (in separate terminal) 1. get address of `ReserveSpenderMultiSig` from `Registry` ✅ ```sh cast call \ "0x000000000000000000000000000000000000ce10" \ "getAddressForStringOrDie(string calldata identifier)(address)" \ "ReserveSpenderMultiSig" \ --rpc-url=http://127.0.0.1:8546 0x1A888D93eeAcF683c68E07Ad58Aa43f2A5742490 ``` 1. Check that the `ReserveSpenderMultiSig` address is in the `isSpender` mapping on the `Reserve` ✅ Context: ```sol mapping(address => bool) public isSpender; ``` Source: `mento-core/contracts/Reserve.sol` Get `Reserve` address from `Registry` ```sh cast call \ "0x000000000000000000000000000000000000ce10" \ "getAddressForStringOrDie(string calldata identifier)(address)" \ "Reserve" \ --rpc-url=http://127.0.0.1:8546 0x0a887500E327375378edF7b7d0E85F0378b8677a ``` ``` cast call \ "0x0a887500E327375378edF7b7d0E85F0378b8677a" \ "isSpender(address)(bool)" \ "0x1A888D93eeAcF683c68E07Ad58Aa43f2A5742490" \ --rpc-url=http://127.0.0.1:8546 true ```