Skip to content

Commit

Permalink
Added examples of calling natvive smart contracts from Solidity to re…
Browse files Browse the repository at this point in the history
…lease notes
  • Loading branch information
saratnt committed Nov 10, 2023
1 parent 8f7aab3 commit b795102
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions doc/release/0.9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,39 @@ The EVM Smart Contract can invoke a Native Smart Contract function using the fol
`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}();
// ...
```





---
## Update instructions from previous version

Expand Down

0 comments on commit b795102

Please sign in to comment.