Skip to content

Update foundry.mdx[Fix Foundry script] #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 24 additions & 16 deletions docs/build/toolchains/foundry.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,30 @@ Just provide the Telos RPC URL and Chain ID when deploying and verifying your co

``` bash

forge create --rpc-url "https://mainnet.telos.net/evm" --private-key <your_private_key> --verify src/MyContract.sol:MyContract
forge create --rpc-url https://mainnet.telos.net/evm \
--private-key <your_private_key> \
src/MyContract.sol:MyContract \
--legacy \
--verify \
--verifier sourcify

```

### Verify an Existing Smart Contract

``` bash

forge verify-contract \
--chain-id 40 \
--num-of-optimizations 200 \
--compiler-version v0.8.10+commit.fc410830 \
<the_contract_address> \
src/MyToken.sol:MyToken
forge verify-contract <the_contract_address> \
src/MyContract.sol:MyContract \
--chain-id 40 \
--verifier sourcify

```

:::note

--num-of-optimizations will default to 0 if not set on verification, while it defaults to 200 if not set on deployment, so make sure you pass --num-of-optimizations 200 if you left the default compilation settings.
- Since it needs to be deployed on the Telos EVM instead of Ethereum, you need to specify the Telos corresponding validator `sourcify` instead of the default `etherscan`;
- You need to wait a few minutes to see the verification result.

:::

Expand All @@ -53,24 +57,28 @@ forge verify-contract \

``` bash

forge create --rpc-url "https://testnet.telos.net/evm" --private-key <your_private_key> --verify src/MyContract.sol:MyContract
forge create --rpc-url https://testnet.telos.net/evm \
--private-key <your_private_key> \
src/MyContract.sol:MyContract \
--legacy \
--verify \
--verifier sourcify

```

### Verify an Existing Smart Contract

``` bash

forge verify-contract \
--chain-id 41 \
--num-of-optimizations 200 \
--compiler-version v0.8.10+commit.fc410830 \
<the_contract_address> \
src/MyToken.sol:MyToken
forge verify-contract <the_contract_address> \
src/MyContract.sol:MyContract \
--chain-id 41 \
--verifier sourcify

```
:::note

--num-of-optimizations will default to 0 if not set on verification, while it defaults to 200 if not set on deployment, so make sure you pass --num-of-optimizations 200 if you left the default compilation settings.
- Since it needs to be deployed on the Telos EVM instead of Ethereum, you need to specify the Telos corresponding validator `sourcify` instead of the default `etherscan`;
- You need to wait a few minutes to see the verification result.

:::