@@ -11,7 +11,7 @@ To deploy a contract, you must provide a RPC URL (env: `ETH_RPC_URL`) and the pr
1111To deploy ` MyContract ` to a network:
1212
1313``` sh
14- $ forge create --rpc-url < your_rpc_url > --private-key < your_private_key > src/MyContract.sol:MyContract
14+ $ forge create src/MyContract.sol:MyContract --rpc-url < YOUR_RPC_URL > --private-key < YOUR_PRIVATE_KEY >
1515compiling...
1616success.
1717Deployer: 0xa735b3c25f...
@@ -44,12 +44,11 @@ contract MyToken is ERC20 {
4444Additionally, we can tell Forge to verify our contract on Etherscan, Sourcify or Blockscout, if the network is supported, by passing ` --verify ` .
4545
4646``` sh
47- $ forge create --rpc-url < your_rpc_url > \
47+ $ forge create src/MyToken.sol:MyToken --rpc-url < YOUR_RPC_URL > \
4848 --constructor-args " ForgeUSD" " FUSD" 18 1000000000000000000000 \
49- --private-key < your_private_key> \
50- --etherscan-api-key < your_etherscan_api_key> \
51- --verify \
52- src/MyToken.sol:MyToken
49+ --private-key < YOUR_PRIVATE_KEY> \
50+ --etherscan-api-key < YOUR_ETHERSCAN_API_KEY> \
51+ --verify
5352```
5453
5554## Multi-chain deployments
@@ -89,7 +88,7 @@ contract CounterScript is Script {
8988When running:
9089
9190``` sh
92- $ forge script script/CounterScript.s.sol --slow --multi --broadcast --private-key < your_private_key > --verify
91+ $ forge script script/CounterScript.s.sol --slow --multi --broadcast --private-key < YOUR_PRIVATE_KEY > --verify
9392```
9493
9594The script will create the Sepolia Mainnet fork (` vm.createSelectFork("sepolia") ` ), deploy and verify the ` Counter ` contract, and then move to Base Sepolia chain deployment (` vm.createSelectFork("base-sepolia") ` ).
@@ -124,15 +123,13 @@ Let's say you want to verify `MyToken` (see above). You set the [number of optim
124123Here's how to verify it:
125124
126125``` bash
127- forge verify-contract \
126+ forge verify-contract < CONTRACT_ADDRESS > src/MyToken.sol:MyToken \
128127 --chain-id 11155111 \
129128 --num-of-optimizations 1000000 \
130129 --watch \
131130 --constructor-args $( cast abi-encode " constructor(string,string,uint256,uint256)" " ForgeUSD" " FUSD" 18 1000000000000000000000) \
132- --etherscan-api-key < your_etherscan_api_key> \
133- --compiler-version v0.8.10+commit.fc410830 \
134- < the_contract_address> \
135- src/MyToken.sol:MyToken
131+ --etherscan-api-key < YOUR_ETHERSCAN_API_KEY> \
132+ --compiler-version v0.8.10+commit.fc410830
136133
137134Submitted contract for verification:
138135 Response: ` OK`
@@ -158,7 +155,7 @@ If the `--watch` flag was not supplied, you can check
158155the verification status with the [` forge verify-check` ](/forge/reference/forge-verify-check) command:
159156
160157` ` ` bash
161- $ forge verify-check --chain-id 11155111 < GUID> < your_etherscan_api_key >
158+ $ forge verify-check --chain-id 11155111 < GUID> < YOUR_ETHERSCAN_API_KEY >
162159Contract successfully verified.
163160```
164161
0 commit comments