It is now possible for an EVM Smart Contract to invoke a Native Smart Contract function and vice-versa. The EVM Smart Contract can invoke a Native Smart Contract function using the following low-level functions:
staticcall
call
delegatecall
and callcode
cannot be used instead, they will return an error in case they are used with Native
Smart Contracts.
In addition, it is possible to use the Solidity interface describing the Native Smart Contract.
Files with the Native Smart Contract Solidity interfaces can be found under:
qa/SidechainTestFramework/account/smart_contract_resources/contracts/
.
Example of Native Smart Contract invocation in Solidity using low-level staticcall
function:
// ...
address contractAddr = address(0x0000000000000000000022222222222222222222);
(bool success, bytes memory result) = contractAddr.staticcall{gas: 100000}(
abi.encodeWithSignature("getAllForgersStakes()")
);
// ...
Example using Solidity interface:
import "./ForgerStakes.sol";
// ...
ForgerStakes nativeContract = ForgerStakes(0x0000000000000000000022222222222222222222);
nativeContract.getAllForgersStakes{gas: 100000}();
// ...
- Install Python version 3.10
Full Changelog file here