aligned_layer icon indicating copy to clipboard operation
aligned_layer copied to clipboard

feat: add upgrade script for contracts

Open NicolasRampoldi opened this issue 1 year ago • 0 comments

Description

  • To test:
    • In anvil: First, run:
      make anvil_start
      
      Run:
      cast call <aligned_layer_service_manager_proxy_address> "ping()(uint256)"
      
      You can find this address (alignedLayerServiceManager) in the deployment output file. Here, we are trying to call the ping method in the AlignedLayerServiceManager proxy. We should get an error because it doesn't exist. Go to the AlignedLayerServiceManager.sol contract and add the following method:
      function ping() public pure returns (uint256) {
          return 42;
      }
      
      Kill the anvil testnet. Then, make sure the PRIVATE_KEY env variable is set to the private key of the Aligned Layer Upgrader and run:
      make anvil_upgrade_aligned_contracts
      
      Start anvil:
      make anvil_start
      
      Finally, run:
      cast call <aligned_layer_service_manager_proxy_address> "ping()(uint256)"
      
      You should see the number 42.
    • In testnet: First, run:
      cast call <aligned_layer_service_manager_proxy_address> "ping()(uint256)" --rpc-url <rpc_url>
      
      You can find this address (alignedLayerServiceManager) in the deployment output file. Here, we are trying to call the ping method in the AlignedLayerServiceManager proxy. We should get an error because it doesn't exist. Go to the AlignedLayerServiceManager.sol contract and add the following method:
      function getAnswer() public pure returns (uint256) {
          return 42;
      }
      
      Then, make sure the PRIVATE_KEY env variable is set to the private key of the Aligned Layer Upgrader and run:
      make anvil_upgrade_aligned_contracts
      
      Finally, run cast call <aligned_layer_service_manager_proxy_address> "ping()(uint256)" --rpc-url <rpc_url>. You should see the number 42.

NicolasRampoldi avatar May 24 '24 00:05 NicolasRampoldi