tip: 174 title: CHAINID instructions in TVM author: email@example.com status: Final type: Standards Track category : VM created: 2020-08-12
To provide CHAINID instruction in TVM.
This is value can be read from smart contract to distinguish current chain with other chains.
Currently we have multiple chains in TRON ecosystem those are build from 3 main ways: testnets, side-chain and cross-chains.From smart contract perspective, currently we don't have a mechnism to distinguish those chains, which leads to potential replay attacks. As a result, a chainid parameter is required in TVM level to guanrantee smart contract safety.
CHAINID takes 0 operands pop up from stack.
The return value is the genesis block id for this chain as uint256.