
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
contracts-cli
Advanced tools
A command line tool for interacting with smart contracts
from inside contracts-cli directory run:
❯ yarn
❯ yarn build
❯ yarn link
to start the cli run contracts-cli from the command line passing an Ethereum client JSON-RPC URL and a relative path to a folder containing JSON ABI files of contracts you wish to interact with, e.g:
contracts-cli --abi-dir=./abi --rpc-url=https://ropsten.infura.io/FWLG9Y
other optional inputs include:
--testnet
--config-path=<path to config file, example below>
Here you can set contract addresses you frequently interact with to save entering them in the cli each time, they just need a mapping to the names of your JSON ABI files, e.g:
{
"contractAddresses": {
"MyTokenContract": {
"testnet": "0xe16f1563984209fe47f8236f8b01a03f03f957e4",
"mainnet": "0xab2c7238198ad8b389666574f2d8bc411a4b7428"
},
"OtherContract": {
"testnet": "0xcefd4590d131480f100ac58b845314a978b0ec70",
"mainnet": "0xb2d2130530d77418b3e367fe162808887526e74d"
},
},
rpcUrl: {
"testnet": "https://ropsten.infura.io/<KEY>",
"mainnet": "https://mainnet.infura.io/<KEY>"
}
}
1. Select a wallet provider
2. Select a contract to interact with
abi folder, you can also optionally set addresses for contracts in config.json, if no address is set you will be prompted to provide one on contract selection.3. Select or set contract address
3. Select contract method
4. Enter arguments and confirm
FAQs
Command line tool for interacting with Ethereum smart contracts
We found that contracts-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.