Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a785615
git add evm/interchainTokenFactory.jschore: added contract id script …
benjamin852 Sep 22, 2025
0b8f2b4
chore: refactored remaining its factory functionality, todo still int…
benjamin852 Sep 24, 2025
dbe71be
chore: added note on interchain token deploy salt
benjamin852 Sep 25, 2025
36c3989
chore: added readme and fixed logging bug for actions
benjamin852 Sep 26, 2025
7fef7d3
chore: fixed description for get interchain token deploy salt
benjamin852 Sep 26, 2025
1c88a57
chore: resolved conflicts
benjamin852 Sep 26, 2025
79442d3
chore: update github action for its factory command names
benjamin852 Sep 26, 2025
63913f9
chore: remove action and param names on its factory actions
benjamin852 Sep 26, 2025
d870208
chore: fixed args on deploy-interchain-token and link-token for githu…
benjamin852 Sep 26, 2025
2c4e2bc
fix: removed typo in github action and fixed typo in readme
benjamin852 Sep 29, 2025
3d9f83a
doc: add itsFactory deploy commands to release template
benjamin852 Oct 6, 2025
bb20646
chore: added the gasValue destructuring and fixed conflicts
benjamin852 Oct 6, 2025
6480f87
chore: linter
benjamin852 Oct 6, 2025
de8f0ba
chore: removed ex response from readme
benjamin852 Oct 6, 2025
cfc1f9c
chore: remove debug console.log
benjamin852 Oct 14, 2025
14f76a8
chore: removed double param verification in interchain token deploy s…
benjamin852 Oct 15, 2025
1d79bdd
chore: refactored ITS factory evm commands to have flagged inputs
benjamin852 Oct 16, 2025
eb45251
chore: fixed up release templates to account for new its factory actions
benjamin852 Oct 16, 2025
22bb548
doc: adjusted readme for its factory to match new actions
benjamin852 Oct 16, 2025
b836404
chore: added ts-node in release template
benjamin852 Oct 16, 2025
a73b69b
chore: refactor args to options
benjamin852 Oct 17, 2025
1646198
chore: removed commented code
benjamin852 Oct 17, 2025
13d891a
Merge branch 'main' into chore/its-factory-update
benjamin852 Oct 17, 2025
f69020d
Merge branch 'main' into chore/its-factory-update
benjamin852 Oct 17, 2025
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
8 changes: 4 additions & 4 deletions .github/workflows/test-evm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,23 +166,23 @@ jobs:
run: ts-node evm/its.js is-trusted-chain remote -y

- name: InterchainTokenFactory deploy interchain token on current chain
run: ts-node evm/interchainTokenFactory.js --action deployInterchainToken --name "test" --symbol "TST" --decimals 18 --minter 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y
run: ts-node evm/interchainTokenFactory.js deploy-interchain-token --name "test" --symbol "TST" --decimals 18 --initialSupply 12345 --minter 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y

- name: InterchainTokenFactory deploy interchain token to destination chain
run: ts-node evm/interchainTokenFactory.js --action deployRemoteInterchainToken --destinationChain remote --salt "salt" -y
run: ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token --destinationChain remote --salt "salt" -y

# Note that tokenAddress is hardcoded since it's derivation must always be the same
- name: InterchainTokenService register token metadata
run: ts-node evm/its.js register-token-metadata 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 -y

- name: InterchainTokenFactory register custom token
run: ts-node evm/interchainTokenFactory.js --action registerCustomToken --tokenAddress 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 --tokenManagerType 4 --operator 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y
run: ts-node evm/interchainTokenFactory.js register-custom-token --tokenAddress 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 --tokenManagerType 4 --operator 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y

- name: Transfer mintership of token to token manager
run: ts-node evm/its.js transfer-mintership 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -y

- name: InterchainTokenFactory link token
run: ts-node evm/interchainTokenFactory.js --action linkToken --destinationChain remote --destinationTokenAddress "0x1234" --tokenManagerType 4 --linkParams "0x5678" --salt "salt" -y
run: ts-node evm/interchainTokenFactory.js link-token --destinationChain remote --destinationTokenAddress "0x1234" --tokenManagerType 4 --linkParams "0x5678" --salt "salt" -y

# Note that tokenId is hardcoded since it's derivation must always be the same
- name: InterchainTokenService interchain transfer to destination chain
Expand Down
164 changes: 164 additions & 0 deletions evm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,3 +488,167 @@ ts-node evm/its.js link-token --salt [deploy-salt] [token-id] [destination-chain
```

The raw `bytes32` salt can be provided via `--rawSalt [raw-salt]` instead of hashing the provided salt string.

## Interchain Token Factory

The Interchain Token Factory is responsible for deploying new interchain tokens and managing their token managers. It has the following functionality:

### Contract-Id

Getter for the contract id.

```bash
ts-node evm/interchainTokenFactory.js contract-id --chainNames <chain_name> --env <env>
```

Example:

```bash
ts-node evm/interchainTokenFactory.js contract-id --chainNames avalanche --env testnet
```


### Interchain Token Deploy Salt

Computes the deploy salt for an interchain token.

```bash
ts-node evm/interchainTokenFactory.js interchain-token-deploy-salt --deployer <deployer> --chainNames <chain_name> --env <env> --salt <salt>
```

Example:

```bash
ts-node evm/interchainTokenFactory.js interchain-token-deploy-salt --deployer 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f --chainNames ethereum-sepolia --env testnet --salt 0x4ab94b9bf7e0a1c793d3ff3716b18bb3200a224832e16d1d161bb73a698c8253
```

### Canonical Interchain Token Deploy Salt

Computes the deploy salt for a canonical interchain token.

```bash
ts-node evm/interchainTokenFactory.js canonical-interchain-token-deploy-salt --tokenAddress <token_address> --chainNames <chain_name> --env <env>
```

Example:

```bash
ts-node evm/interchainTokenFactory.js canonical-interchain-token-deploy-salt --tokenAddress 0x8A80b16621e4a14Cb98B64Fd2504b8CFe0Bf5AF1 --chainNames ethereum-sepolia --env testnet
```

### Canonical Interchain Token Id

Computes the ID for a canonical interchain token based on its address.

```bash
ts-node evm/interchainTokenFactory.js canonical-interchain-token-id --tokenAddress <token_address> --chainNames <chain_name> --env <env>

```

Example:

```bash
ts-node evm/interchainTokenFactory.js canonical-interchain-token-id --tokenAddress 0x8A80b16621e4a14Cb98B64Fd2504b8CFe0Bf5AF1 --chainNames ethereum-sepolia --env testnet
```

### Interchain Token Id

Computes the ID for an interchain token based on the deployer and a salt.

```bash
ts-node evm/interchainTokenFactory.js interchain-token-id --deployer <deployer> --chainNames <chain_name> --env <env> --salt <salt>
```

Example:

```bash
ts-node evm/interchainTokenFactory.js interchain-token-id --deployer 0x312dba807EAE77f01EF3dd21E885052f8F617c5B --chainNames avalanche --env testnet --salt 0x48d1c8f6106b661dfe16d1ccc0624c463e11e44a838e6b1f00117c5c74a2cd82
```

### Deploy Interchain Token

Creates a new token and optionally mints an initial amount to a specified minter

```bash
ts-node evm/interchainTokenFactory.js deploy-interchain-token --name <name> --symbol <symbol> --decimals <decimals> --initialSupply <initialSupply> --minter <minter> --chainNames <chain_name> --env <env> --salt <salt>
```


Example:

```bash
ts-node evm/interchainTokenFactory.js deploy-interchain-token --name Test_Token --symbol TT --decimals 18 --initialSupply 12345 --minter 0x312dba807EAE77f01EF3dd21E885052f8F617c5B --chainNames ethereum-sepolia --env testnet --salt 0x7abda5c65fc2720ee1970bbf2a761f6d5b599065283d3c184cb655066950e51a
```


### Deploy Remote Interchain Token

Deploys a remote interchain token on a specified destination chain. No additional minter is set on the deployed token.

```bash
ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token --destinationChain <destination_chain> --chainNames <chain_name> --env <env> --salt <salt>
```

Example:

```bash
ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token --destinationChain Avalanche --chainNames ethereum-sepolia --env testnet --salt 0x7abda5c65fc2720ee1970bbf2a761f6d5b599065283d3c184cb655066950e51a
```


### Register Canonical Interchain Token

Registers a canonical token as an interchain token and deploys its token manager.

```bash
ts-node evm/interchainTokenFactory.js register-canonical-interchain-token --tokenAddress <token_address> --chainNames <chain_name> --env <env>
```

Example:

```bash
ts-node evm/interchainTokenFactory.js register-canonical-interchain-token --tokenAddress 0xff0021D9201B51C681d26799A338f98741fBBB6a --chainNames ethereum-sepolia --env testnet
```

### Deploy Remote Canonical Interchain Token

Deploys a canonical interchain token on a remote chain.

```bash
ts-node evm/interchainTokenFactory.js deploy-remote-canonical-interchain-token --tokenAddress <token_address> --destinationChain <destination_chain> --chainNames <chain_name> --env <env>
```

Example:

```bash
ts-node evm/interchainTokenFactory.js deploy-remote-canonical-interchain-token --tokenAddress 0x4a895FB659aAD3082535Aa193886D7501650685b --destinationChain Avalanche --chainNames ethereum-sepolia --env testnet
```

### Register Custom Token

Register an existing ERC20 token under a `tokenId` computed from the provided `salt`.

```bash
ts-node evm/interchainTokenFactory.js register-custom-token --tokenAddress <token_address> --tokenManagerType <token_manager_type> --operator <operator> --chainNames <chain_name> --env <env> --salt <salt>
```


Example:

```bash
ts-node evm/interchainTokenFactory.js register-custom-token --tokenAddress 0x0F6814301C0DA51bFddA9D2A6Dd877950aa0F912 --tokenManagerType 4 --operator 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f --chainNames ethereum-sepolia --env testnet --salt 0x3c39e5b65a730b26afa28238de20f2302c2cdb00f614f652274df74c88d4bb50
```

### Link Token

Links a remote token on `destinationChain` to a local token corresponding to the `tokenId` computed from the provided `salt`.

```bash
ts-node evm/interchainTokenFactory.js link-token --destinationChain <destination_chain> --destinationTokenAddress <destination_token_address> --tokenManagerType <token_manager_type> --linkParams <link_params> --chainNames <chain_name> --env <env> --salt <salt>
```

Example:

```bash
ts-node evm/interchainTokenFactory.js link-token --destinationChain Avalanche --destinationTokenAddress 0xB98cF318A3cB1DEBA42a5c50c365B887cA00133C --tokenManagerType 4 --linkParams 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f --chainNames ethereum-sepolia --env testnet --yes --salt 0x3c39e5b65a730b26afa28238de20f2302c2cdb00f614f652274df74c88d4bb40
```
Loading