Skip to content

Commit

Permalink
Governance EVM support (#719)
Browse files Browse the repository at this point in the history
* Governance EVM support

* Small adjustments

---------

Co-authored-by: Igor Papandinas <[email protected]>
  • Loading branch information
Dinonard and ipapandinas authored Nov 29, 2024
1 parent fc1ffba commit 72bec39
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 25 deletions.
43 changes: 26 additions & 17 deletions docs/build/EVM/precompiles/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,35 @@ The Frontier EVM used on Astar network provides several useful precompiled contr

## Ethereum Native Precompiles

| Precompile | Address |
| -------- | -------- |
| ECRecover | 0x0000000000000000000000000000000000000001 |
| Sha256 | 0x0000000000000000000000000000000000000002 |
| Ripemd160 | 0x0000000000000000000000000000000000000003 |
| Identity | 0x0000000000000000000000000000000000000004 |
| Modexp | 0x0000000000000000000000000000000000000005 |
| Bn128Add | 0x0000000000000000000000000000000000000006 |
| Bn128Mul | 0x0000000000000000000000000000000000000007 |
| Bn128Pairing | 0x0000000000000000000000000000000000000008 |
| Precompile | Address |
| ------------- | -------------------------------------------- |
| ECRecover | 0x0000000000000000000000000000000000000001 |
| Sha256 | 0x0000000000000000000000000000000000000002 |
| Ripemd160 | 0x0000000000000000000000000000000000000003 |
| Identity | 0x0000000000000000000000000000000000000004 |
| Modexp | 0x0000000000000000000000000000000000000005 |
| Bn128Add | 0x0000000000000000000000000000000000000006 |
| Bn128Mul | 0x0000000000000000000000000000000000000007 |
| Bn128Pairing | 0x0000000000000000000000000000000000000008 |

## Non-Ethereum Native Precompiles

| Precompile | Address |
| ------------------- | -------------------------------------------- |
| Sha3FIPS256 | 0x0000000000000000000000000000000000000400 |
| Dispatch | 0x0000000000000000000000000000000000000401 |
| ECRecoverPublicKey | 0x0000000000000000000000000000000000000402 |
| Ed25519Verify | 0x0000000000000000000000000000000000000403 |

## Astar Specific Precompiles

| Precompile | Address |
| -------- | -------- |
| [DappsStaking](staking.md) | 0x0000000000000000000000000000000000005001 |
| [Sr25519](sr25519.md) | 0x0000000000000000000000000000000000005002 |
| [SubstrateEcdsa](substrate-ecdsa.md) | 0x0000000000000000000000000000000000005003 |
| [XCM](xcm/xcm.md) | 0x0000000000000000000000000000000000005004 |
| [assets-erc20](xc20.md) | ASSET_PRECOMPILE_ADDRESS_PREFIX |
| Precompile | Address |
| --------------------------------- | -------------------------------------------- |
| [DappsStaking](staking.md) | 0x0000000000000000000000000000000000005001 |
| [Sr25519](sr25519.md) | 0x0000000000000000000000000000000000005002 |
| [SubstrateEcdsa](substrate-ecdsa.md) | 0x0000000000000000000000000000000000005003 |
| [XCM](xcm/xcm.md) | 0x0000000000000000000000000000000000005004 |
| [assets-erc20](xc20.md) | ASSET_PRECOMPILE_ADDRESS_PREFIX |

The interface descriptions for these precompiles can be found in the `precompiles` folder: [Astar repo](https://github.com/AstarNetwork/Astar/).
The Addresses can be checked in the [Astar repo](https://github.com/AstarNetwork/Astar/tree/master/runtime) for each runtime in `precompile.rs` files.
Expand Down
1 change: 0 additions & 1 deletion docs/build/EVM/precompiles/staking.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
The dApp Staking Precompile allows EVM smart contracts to access `pallet-dapp-staking` functionality.

For more information see `precompiles/dapps-staking-v3` in the [`Astar` repository](https://github.com/AstarNetwork/Astar/).

2 changes: 1 addition & 1 deletion docs/build/EVM/precompiles/xc20.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ XC20 standard, created by the Moonbeam team, ensures compatibility between the E

For XC20 overview see the following [page](/docs/learn/interoperability/xcm/building-with-xcm/create-xc20-assets).

# See also
## See also

- https://github.com/ethereum/EIPs/issues/20
- https://github.com/OpenZeppelin/openzeppelin-contracts
2 changes: 2 additions & 0 deletions docs/learn/governance/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ The solution is live on both **Shibuya** and **Astar** networks.

There is no plan to deploy the solution on **Shiden** network.

Regular _Substrate-style_ SS58 accounts can be used to participate in governance, as well as _Ethereum-style_ H160 accounts (via the `dispatch` precompile).

## Approach

`Astar` reuses Polkadot’s so-called **v1** governance model due to its practicality. The core idea is to further decentralize the network, but not completely re-invent the wheel.
Expand Down
22 changes: 16 additions & 6 deletions docs/use/governance/subsquare_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ import Figure from "/src/components/figure"

## Intro

:::note
This is _work-in-progress_.
All information here should be correct, but the guide will be updated prior to the launch on Astar.
:::

Astar Network is transitioning its governance system from off-chain voting through Townhall to on-chain voting. This change empowers Astar stakeholders to directly vote on key network proposals and decisions on-chain. Astar governance allows ASTR token holders to influence and participate in decisions that affect the network, such as protocol improvements, runtime updates, and dApp Staking applications.

To interact with the on-chain governance, users have two primary interfaces to choose from: [Subsquare](https://www.subsquare.io/) or the traditional [Polkadot.js](https://polkadot.js.org/apps/) interface. Subsquare provides a user-friendly interface for governance participation, while Polkadot.js offers a more technical approach.
Expand All @@ -26,7 +21,8 @@ Astar governance is a decentralized mechanism where ASTR token holders can propo
For a deeper understanding of Astar governance, including its structure and processes, we encourage you to read the [Astar Governance Overview](/docs/learn/governance/index.md) in our documentation.

## Using Subsquare for On-Chain Governance
[Subsquare](https://www.subsquare.io/) is designed to make on-chain governance participation easy for all users. Through Subsquare, you can:

[Subsquare](https://astar.subsquare.io/) is designed to make on-chain governance participation easy for all users. Through Subsquare, you can:

- View active proposals.
- Participate in discussions.
Expand All @@ -39,6 +35,20 @@ Working assumption is that the reader has familiarized themselves with the gover
- [Shibuya Subsquare](https://shibuya.subsquare.io/)
- [Astar Subsquare](https://astar.subsquare.io/)

## Account Selection

Both Substrate & EVM style accounts can participate in governance actions.

When connecting an account to the Subsquare platform, the user can choose between different wallets and account types.

<Figure caption="Substrate Account Selection" src={require('/docs/use/img/25_Subsquare_wallet_account_selection/wallet_account_1.png').default } width="100%" />

Different _Substrate_ account compatible wallets are available. If the user wants to use their EVM account, they should select `EVM` under the option.

<Figure caption="EVM Account Selection" src={require('/docs/use/img/25_Subsquare_wallet_account_selection/wallet_account_2.png').default } width="100%" />

Here, the user can select the desired EVM wallet.

## Token Holder

### Preimages
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 72bec39

Please sign in to comment.