aligned_layer
aligned_layer copied to clipboard
feat: add upgrade script for contracts
Description
- To test:
- In anvil:
First, run:
Run:make anvil_start
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 thecast call <aligned_layer_service_manager_proxy_address> "ping()(uint256)"AlignedLayerServiceManager.solcontract and add the following method:
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:function ping() public pure returns (uint256) { return 42; }
Start anvil:make anvil_upgrade_aligned_contracts
Finally, run:make anvil_start
You should see the number 42.cast call <aligned_layer_service_manager_proxy_address> "ping()(uint256)" - In testnet:
First, run:
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 thecast call <aligned_layer_service_manager_proxy_address> "ping()(uint256)" --rpc-url <rpc_url>AlignedLayerServiceManager.solcontract and add the following method:
Then, make sure the PRIVATE_KEY env variable is set to the private key of the Aligned Layer Upgrader and run:function getAnswer() public pure returns (uint256) { return 42; }
Finally, runmake anvil_upgrade_aligned_contractscast call <aligned_layer_service_manager_proxy_address> "ping()(uint256)" --rpc-url <rpc_url>. You should see the number 42.
- In anvil:
First, run: