Smart Contract
Building Non-Stop
Last updated
Building Non-Stop
Last updated
JSON-RPC Endpoints
To interact with C-Chain via the JSON-RPC endpoint:
To interact with other instances of the EVM via the JSON-RPC endpoint:
where blockchainID
is the ID of the blockchain running the EVM.
WebSocket Endpoints
To interact via the websocket endpoint:
For example, to interact with the C-Chain's Ethereum APIs via websocket on localhost you can use:
To interact with other instances of the EVM via the websocket endpoint:
where blockchainID
is the ID of the blockchain running the EVM.
GEMNODE offers an API interface identical to Geth's API except that it only supports the following services:
web3_
net_
eth_
personal_
txpool_
debug_
(note: this is turned off on the public api node.)
In addition to the standard Ethereum APIs, Avalanche offers eth_getAssetBalance
to retrieve the balance of first class Avalanche Native Tokens on the C-Chain (excluding AVAX, which must be fetched with eth_getBalance
).
Signature
address
owner of the asset
blk
is the block number or hash at which to retrieve the balance
assetID
id of the asset for which the balance is requested
Example Call
Example Response
Get the base fee for the next block.
result
is the hex value of the base fee for the next block.
Get the priority fee needed to be included in a block.
result
is hex value of the priority fee needed to be included in a block.
eth_getChainConfig
returns chain config. This API is enabled by default with internal-eth
namespace.
Signature
Example Call
Example Response
Coming Soon!
Navigate to your published contract address on the explorer
On the code
tab select verify & publish
Copy and paste the flattened source code and enter all the build parameters exactly as they are on the published contract
Click verify & publish
If successful, the code
tab will now have a green checkmark, and your users will be able to verify the contents of your contract. This is a strong positive signal that your users can trust your contracts, and it is strongly recommended for all production contracts.
You can interact with these services the same exact way youβd interact with Geth. See the and for a full description of this API.
Signature
Example Call
Example Response
Signature
Example Call
Example Response
For more information on dynamic fees see the .
Smart contract verification provides transparency by publishing the source code, allowing everyone to attest that it really does what it claims to do. You can verify your smart contracts using the . The procedure is simple:
Once deployed, it would be tough to fix bugs on decentralized applications due to its nature. Hence, it's vital to ensure an app operates properly before deployment. Contract security reviews can be done by specialized companies and services, but they will be costly. To avoid paying sky high audit fees, developers can use free resources as , , .