You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build/EVM/precompiles/index.md
+25-7Lines changed: 25 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,23 +44,41 @@ The Addresses can be checked in the [Astar repo](https://github.com/AstarNetwork
44
44
45
45
## Usage Example
46
46
47
-
Here we'll demonstrate how to interact with the dApp staking precompile using Remix IDE. Other precompiles can be accessed in a similar manner.
47
+
This section demonstrates how to interact with the dApp Staking precompile from your contract or using Remix IDE. Other precompiles can be accessed in a similar manner.
48
+
49
+
### From contract
50
+
51
+
`DappsStakingV3.sol` contains functions that _mimic_ the interface of the latest version of `dApp Staking`. The interface can be found in the [Astar repository](https://github.com/AstarNetwork/Astar/blob/master/precompiles/dapp-staking/DappsStakingV3.sol).
52
+
Developers are encouraged to use this interface to fully utilize dApp staking functionality.
48
53
49
54
```solidity
50
-
import "./DappsStaking.sol";
55
+
import "./DappsStakingV3.sol";
56
+
51
57
contract A {
52
-
DappsStaking public constant DAPPS_STAKING = DappsStaking(0x0000000000000000000000000000000000005001);
58
+
DAppStaking public constant DAPPS_STAKING = DAppStaking(0x0000000000000000000000000000000000005001);
The example below uses a soft-deprecated interface from the older dApp Staking v2.
74
+
While it is still supported by the network, it does not reflect the recommended usage for dApp Staking v3.
75
+
Please use the `v3` interface in a similar way for the latest version of the dApp Staking precompile.
76
+
77
+
:::
78
+
61
79
Example use: check `current era` and `total staked amount` in the `pallet-dapps-staking` for Shiden Network. For this example we will use Remix.
62
80
63
-
1. Copy `DappsStaking.sol` from [Astar repo](https://github.com/AstarNetwork/Astar/) and create new contract in Remix:
81
+
1. Copy `DappsStakingV2.sol` from [Astar repo](https://github.com/AstarNetwork/Astar/blob/master/precompiles/dapp-staking/DappsStakingV2.sol) and create new contract in Remix:
0 commit comments