Skip to content

Commit

Permalink
Merge pull request #955 from HorizenOfficial/st/SDK_1602
Browse files Browse the repository at this point in the history
St/sdk 1602
  • Loading branch information
paolocappelletti authored Nov 10, 2023
2 parents e72528a + b795102 commit 04d5af2
Show file tree
Hide file tree
Showing 2 changed files with 35 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
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ interface ForgerStakes {
function delegate(bytes32 publicKey, bytes32 vrf1, bytes1 vrf2, address owner) external payable returns (StakeID);

function withdraw(StakeID stakeId, bytes1 signatureV, bytes32 signatureR, bytes32 signatureS) external returns (StakeID);

function openStakeForgerList(uint32 forgerIndex, bytes32 signature1, bytes32 signature2) external returns (bytes memory);
}

0 comments on commit 04d5af2

Please sign in to comment.