smart contracts done

This commit is contained in:
mfahampshire
2024-09-26 18:58:43 +02:00
parent c0fd0b7b47
commit 3445ec88a7
6 changed files with 30 additions and 15 deletions
@@ -3,7 +3,7 @@
The Nyx blockchain is based on [CosmWasm](https://cosmwasm.com/).
The following contracts are deployed to the chain:
* the [Mixnet contract](./mixnet-contract.md) which manages the network topology of the mixnet and tracks delegations & rewarding.
* the [Vesting contract](./vesting-contract.md) which manages `NYM` token vesting functionality. This will soon be deprecated.
* the [Quorum Multisig](./multisig.md) used by the subset of the Nyx Validators that generate and validate [zk-nyms](../../cryptography/zk-nym) to manage reward payouts for nodes.
* the [zk-nym contract](./ecash.md) which keeps track of `NYM` deposits used as payment for zk-nym generation.
* the [Mixnet contract](./smart-contracts/mixnet-contract.md) which manages the network topology of the mixnet and tracks delegations & rewarding.
* the [Vesting contract](./smart-contracts/vesting-contract.md) which manages `NYM` token vesting functionality. This will soon be deprecated.
* the [Quorum Multisig](./smart-contracts/multisig.md) used by the subset of the Nyx Validators that generate and validate [zk-nyms](../../cryptography/zk-nym) to manage reward payouts for nodes.
* the [zk-nym contract](./smart-contracts/ecash.md) which keeps track of `NYM` deposits used as payment for zk-nym generation.
@@ -1,10 +0,0 @@
# Zk-Nym Contract
NOTE the contract repo is called 'ecash' from back in the day: this is the contract that is responsible fr zk-nyms tho
functions - these are controlled by the multisig:
- get blacklisted
- set blacklisted
- deposit funds for tickets (called by zk-nym payment backend)
- propose to redeem tickets (gws call this)
- execute proposals (multisig)
@@ -0,0 +1,25 @@
import { Callout } from 'nextra/components'
# Zk-Nym Contract
<Callout type="info" emoji="️">
Note that within the monorepo contract repo this contract is referred to as `ecash`. This is a historical artifact that hasn't yet been changed.
</Callout>
This contract is a hub for zk-nym related actions, being called by either:
- the zk-nym payment backend
- nodes running in Gateway mode
- the multisig contract
### Functionality
- The following functionality is controlled by the multisig contract:
- getting the list of blacklisted addresses who have tried to double-spend a zk-nym.
- proposing to add an address to the blacklist.
- executing an open proposal.
- The the zk-nym [payment backend](../../../cryptography/zk-nym-overview) can deposit funds with information used to identify the deposit.
- Finally, nodes running as Gateways can create a proposal to redeem a set of spend zk-nyms.
> The addresses of deployed smart contracts can be found in the [`network-defaults`](https://github.com/nymtech/nym/blob/master/common/network-defaults/src/mainnet.rs) directory of the codebase alongside other network default values.
@@ -7,7 +7,7 @@ The Mixnet smart contract is a core piece of the Nym system, functioning as the
Functionality
The Mixnet contract has multiple functions:
* storing bonded mix node and gateway information (and removing this on unbonding).
* **providing the network-topology to the (cached) validator API endpoint used by clients on startup for routing information.**
* **providing the network-topology to the (cached) Validator API endpoint used by clients on startup for routing information.**
* storing delegation and bond amounts.
* storing reward amounts.