Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
cpchain-cli
Advanced tools
This tool aim to help developer develop smart contract on CPChain mainnet.
npm install -g cpchain-cli
cpchain-cli help
cpchain-cli generate -n MyContract
cd MyContract
# Test contract
truffle test
Before deploying contract on the mainnet, we suggest developers the smart contracts on Testnet first to secure test. You can get Test CPC coins by the faucet. This faucet drips 100 CPC every 10 seconds. You can register your account in our queue.
# install tools
pip3 install cpc-fusion
# create a new account
cpc-fusion account create
Now, copy your address and access faucet to get test coins. Then build your contract and deploy it on Testnet:
# build contracts
npm run build
# deploy on testnet (Specify your keystore)
cpc-fusion deploy --keystore <The path of your keystore> --abi build/contracts/MyContract.json --endpoint https://civilian.testnet.cpchain.io --chainID 41
After deploying your contract, you will need to manage it. The cpc-fusion can also support managing deployed contract. Please run as below to get all commands:
cpc-fusion -h
If you want to check all configurations, you can use cpc-fusion get-configs -h
, for example:
cpc-fusion get-configs --abi build/contracts/HelloWorld.json --address <contract address>
If you want to call your contract, you can use cpc-fusion call-func -h
, for example:
cpc-fusion call-func --keystore <keystore/key> --address <contract address> --abi build/contracts/HelloWorld.json --function <function name> --parameters <parameters>
Add you can add --value
to specify the amount of CPC
.
If you want to call view
function to check something, you can use cpc-fusion view-func -h
, for example:
cpc-fusion view-func --abi build/contracts/HelloWorld.json --address <contract address> --function <function name> --parameters <parameters>
# deploy on the Mainnet (Specify your keystore)
cpc-fusion deploy --keystore <The path of your keystore> --abi build/contracts/MyContract.json
npm i
npm link
npm run ts src/index.ts -h
npm run lint
npm run lint:fix
npm run build
# publish
# npm publish
因为当前版本仅支持 commonjs 打包,不支持 ES Modules(官方文档),考虑当需跟上最新的发展,以及很多库已转向 ES Modules,故先弃用 swc 打包方式。
FAQs
A CLI tool for developing smart contracts on CPChain mainnet
The npm package cpchain-cli receives a total of 2 weekly downloads. As such, cpchain-cli popularity was classified as not popular.
We found that cpchain-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.