Skip to content

Commit

Permalink
feat(evm): add transfer mintership cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
milapsheth committed Jan 24, 2025
1 parent c920b07 commit fd051e9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test-evm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ jobs:
- name: InterchainTokenFactory register custom token
run: node evm/interchainTokenFactory.js --action registerCustomToken --tokenAddress 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 --tokenManagerType 4 --operator 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y

- name: Transfer mintership of token to token manager
run: node evm/its.js --action transferMintership --tokenAddress 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 --minter 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -y

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

Expand Down
16 changes: 16 additions & 0 deletions evm/its.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ const {
isNonEmptyString,
isValidChain,
getChainConfig,
isValidAddress,

Check failure on line 27 in evm/its.js

View workflow job for this annotation

GitHub Actions / lint

'isValidAddress' is assigned a value but never used
} = require('./utils');
const { getWallet } = require('./sign-utils');
const IInterchainTokenService = getContractJSON('IInterchainTokenService');
const IMinter = getContractJSON('IMinter');
const InterchainTokenService = getContractJSON('InterchainTokenService');
const InterchainTokenFactory = getContractJSON('InterchainTokenFactory');
const IInterchainTokenDeployer = getContractJSON('IInterchainTokenDeployer');
Expand Down Expand Up @@ -620,6 +622,19 @@ async function processCommand(config, chain, options) {
break;
}

case 'transferMintership': {
const { tokenAddress, minter } = options;

validateParameters({ isValidAddress: { tokenAddress, minter } });

const token = new Contract(tokenAddress, IMinter.abi, wallet);
const tx = await token.transferMintership(minter);

await handleTx(tx, chain, token, options.action, 'MintershipTransferred');

break;
}

default: {
throw new Error(`Unknown action ${action}`);
}
Expand Down Expand Up @@ -662,6 +677,7 @@ if (require.main === module) {
'checks',
'migrateInterchainToken',
'registerTokenMetadata',
'transferMintership',
])
.makeOptionMandatory(true),
);
Expand Down

0 comments on commit fd051e9

Please sign in to comment.