-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Labels
3 Days ETAWithin Three days, send in a PR. Failure to do so will result in a reassignment of your issues.Within Three days, send in a PR. Failure to do so will result in a reassignment of your issues.enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Summary
Create a Node/TypeScript interactive script that lets an admin register tokens via the contract function:
function registerToken(AssetType assetType, address tokenAddress, address priceFeed, uint8 decimals)enum AssetType { ETH, ERC20 }Requirements
-
File path:
scripts/registertoken.ts -
Prompts the admin for:
- Asset Type (
ETHorERC20) - Token Address (skip/zero address if
ETH) - Price Feed Address (Chainlink Sepolia; link in script help)
- Decimals (e.g., 18 for ETH/ERC20)
- Asset Type (
-
Validates inputs (addresses, decimals range, etc.)
-
Loads config from env:
RPC_URL(Sepolia)PRIVATE_KEY(admin)CONTRACT_ADDRESS(ZeroXBridge or Registry contract exposingregisterToken)
-
Displays a full transaction preview and asks for confirmation
-
Sends the tx and prints:
- hash
- mined block number
- gas used
-
Clean exit codes (non-zero on failure)
-
Include minimal ABI for
registerToken+AssetType
Reference
-
Chainlink Sepolia price feeds: (use to pick feed addresses)
Acceptance Criteria
- Running
ts-node scripts/registertoken.ts(orpnpm ts-node …) launches an interactive flow - Successful registration logs tx details; failures provide actionable errors
- Input validation prevents obvious misconfigs (bad address, decimals, etc.)
- Script is documented with a short header comment and usage notes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3 Days ETAWithin Three days, send in a PR. Failure to do so will result in a reassignment of your issues.Within Three days, send in a PR. Failure to do so will result in a reassignment of your issues.enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers