From e053f3fc4ff10c8770994ce20ddb7f33554e390c Mon Sep 17 00:00:00 2001 From: Maddiaa <47148561+cheethas@users.noreply.github.com> Date: Mon, 9 Jan 2023 16:08:27 +0000 Subject: [PATCH] nits: capitalize env vars (#300) --- README.md | 8 ++++---- specs/aztec/dataprovider/readme.md | 6 +++--- src/deployment/base/BaseDeployment.s.sol | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 09fc64f39..08af5b5af 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,8 @@ To get started follow the steps below: 6. Write a deployment script. Make a script that inherits from the `BaseDeployment.s.sol` file. The base provides helper functions for listing assets/bridges and a getter for the rollup address. - Use the env variables `simulateAdmin=false|true` and `network=mainnet|devnet|testnet` to specify how to run it. - With `simulateAdmin=true`, the `listBridge` and `listAsset` helpers will be impersonating an account with access to list, otherwise they are broadcasted. See the example scripts from other bridges for inspiration on how to write the scripts. + Use the env variables `SIMULATE_ADMIN=false|true` and `NETWORK=mainnet|devnet|testnet` to specify how to run it. + With `SIMULATE_ADMIN=true`, the `listBridge` and `listAsset` helpers will be impersonating an account with access to list, otherwise they are broadcasted. See the example scripts from other bridges for inspiration on how to write the scripts. 7. Testing/using your deployment script To run your deployment script, you need to set the environment up first, this include specifying the RPC you will be sending the transactions to and the environment variables from above. You can do it using a private key, or even with a Ledger or Trezor, see the foundry book for more info on using hardware wallets. @@ -62,8 +62,8 @@ To get started follow the steps below: # on testnet this will fetch from the Aztec endpoints, on mainnet, this will lookup the `rollup.aztec.eth` ens export RPC=https://aztec-connect-testnet-eth-host.aztec.network:8545 export PRIV_KEY= # If using a private-key directly - export network=testnet # When using the testnet - export simulateAdmin=false # When you want to broadcast, use `true` if simulating admin + export NETWORK=testnet # When using the testnet + export SIMULATE_ADMIN=false # When you want to broadcast, use `true` if simulating admin forge script --fork-url $RPC --ffi --legacy --private-key $PRIV --sig "" --broadcast # Example script reading the current assets and bridges: diff --git a/specs/aztec/dataprovider/readme.md b/specs/aztec/dataprovider/readme.md index 2011a1701..78c2e127e 100644 --- a/specs/aztec/dataprovider/readme.md +++ b/specs/aztec/dataprovider/readme.md @@ -19,17 +19,17 @@ function getAssets() public view returns (AssetData[] memory); function getBridges() public view returns (BridgeData[] memory); ``` -The easiest way to access it, if already using this repository is to execute the `read()` script in the DataProviderDeployment solidity file. It holds addresses for mainnet, testnet and devnet. +The easiest way to access it, if already using this repository is to execute the `read()` script in the DataProviderDeployment solidity file. It holds addresses for mainnet, testnet and devnet. ```bash -export network= && export simulateAdmin=false +export NETWORK= && export SIMULATE_ADMIN=false export ETH_RPC_URL= forge script DataProviderDeployment --rpc-url $ETH_RPC_URL --sig "read()" ``` ## Usage by owner -Updating values stored in the data provider is only possible by the owner of the contract. +Updating values stored in the data provider is only possible by the owner of the contract. Before running the commands bellow export relevant environment variables: diff --git a/src/deployment/base/BaseDeployment.s.sol b/src/deployment/base/BaseDeployment.s.sol index c8d70e8f9..e59fee53a 100644 --- a/src/deployment/base/BaseDeployment.s.sol +++ b/src/deployment/base/BaseDeployment.s.sol @@ -45,7 +45,7 @@ abstract contract BaseDeployment is Test { function setUp() public virtual { // Read from the .env - string memory networkKey = "network"; + string memory networkKey = "NETWORK"; string memory envNetwork = vm.envString(networkKey); bytes32 envNetworkHash = keccak256(abi.encodePacked(envNetwork)); @@ -72,7 +72,7 @@ abstract contract BaseDeployment is Test { return; } - string memory modeKey = "simulateAdmin"; + string memory modeKey = "SIMULATE_ADMIN"; bool envMode = vm.envBool(modeKey); MODE = envMode ? Mode.SIMULATE_ADMIN : Mode.BROADCAST;