-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9db2f10
commit 0771634
Showing
30 changed files
with
4,176 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[package] | ||
name = "potlock" | ||
version = "0.0.0" | ||
authors = ["you"] | ||
edition = "2021" | ||
publish = false | ||
readme = "README.md" | ||
|
||
[lib] | ||
path = "src/potlock.rs" | ||
|
||
[dependencies.multiversx-sc] | ||
version = "0.52.3" | ||
|
||
[dependencies.multiversx-sc-modules] | ||
version = "=0.52.3" | ||
|
||
[dev-dependencies] | ||
num-bigint = "0.4.2" | ||
|
||
[dev-dependencies.multiversx-sc-scenario] | ||
version = "0.52.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Potlock SC | ||
|
||
## Overview | ||
Potlock is a smart contract designed to enhance and accelerate Public Goods Funding (PGF) by leveraging the power of blockchain technology. Inspired by the collaboration between Potlock and the NEAR Foundation, this contract aims to provide an efficient and transparent mechanism for funding public goods, encouraging community participation, and maximizing the impact of pooled resources. | ||
|
||
## Features | ||
* **Public Goods Funding (PGF)**: Facilitates the pooling of resources for funding projects that benefit the public. | ||
* **Transparent Allocation**: Ensures that funds are distributed transparently according to predefined rules. | ||
* **Decentralized Governance:** Empowers the community to participate in decision-making processes related to fund allocation. | ||
* **Efficient Fund Management**: Optimizes the management and distribution of funds to maximize impact. | ||
|
||
|
||
|
||
## How It Works | ||
|
||
2. **Activation**: | ||
* A POT is defined, where backers and the foundation contribute tokens. | ||
* Anyone can suggest a new POT by paying a fee, but the proposal must be accepted by the admin for it to be activated. | ||
2. **Application and Review**: | ||
* Projects submit their applications to the POT, aiming to secure funding. | ||
* An authority reviews these submissions, evaluating their eligibility and potential impact. | ||
3. **Donation and Matching**: | ||
* Approved projects receive direct contributions from verified donors. | ||
* These donations are further amplified by the POT's value through the Quadratic Funding (QF) model, maximizing the impact of smaller contributions. | ||
4. **Payout**: | ||
* Funds are distributed to the projects based on the matching model. | ||
* After a cooldown period, the process can start again from step 1, with a new or existing POT. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Pem files are used for interactions, but shouldn't be committed | ||
*.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[[bin]] | ||
name = "rust-interact" | ||
path = "src/potlock_interactor_main.rs" | ||
|
||
[package] | ||
name = "rust-interact" | ||
version = "0.0.0" | ||
authors = ["you"] | ||
edition = "2021" | ||
publish = false | ||
|
||
[dependencies] | ||
toml = "0.8.6" | ||
|
||
[dependencies.potlock] | ||
path = ".." | ||
|
||
[dependencies.multiversx-sc-snippets] | ||
version = "0.52.3" | ||
|
||
[dependencies.multiversx-sc] | ||
version = "0.52.3" | ||
|
||
[dependencies.clap] | ||
version = "4.4.7" | ||
features = ["derive"] | ||
|
||
[dependencies.serde] | ||
version = "1.0" | ||
features = ["derive"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
gateway = 'https://devnet-gateway.multiversx.com' | ||
admin = "erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th" | ||
pot_proposer = "erd1spyavw0956vq68xj8y4tenjpq2wd5a9p2c6j8gsz7ztyrnpxrruqzu66jx" | ||
project_proposer = "erd1k2s324ww2g0yj38qn2ch2jwctdy8mnfxep94q9arncc6xecg3xaq6mjse8" | ||
pot_donor = "erd1kyaqzaprcdnv4luvanah0gfxzzsnpaygsy6pytrexll2urtd05ts9vegu7" | ||
project_donor = "erd18tudnj2z8vjh0339yu3vrkgzz2jpz8mjq0uhgnmklnap6z33qqeszq2yn4" |
32 changes: 32 additions & 0 deletions
32
contracts/potlock/interact-rs/src/potlock_interactor_config.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use multiversx_sc_snippets::imports::Bech32Address; | ||
use serde::Deserialize; | ||
use std::io::Read; | ||
|
||
/// Config file | ||
const CONFIG_FILE: &str = "config.toml"; | ||
|
||
/// Multisig Interact configuration | ||
#[derive(Debug, Deserialize)] | ||
pub struct Config { | ||
gateway: String, | ||
pub admin: Bech32Address, | ||
pub pot_proposer: Bech32Address, | ||
pub project_proposer: Bech32Address, | ||
pub pot_donor: Bech32Address, | ||
pub project_donor: Bech32Address, | ||
} | ||
|
||
impl Config { | ||
// Deserializes config from file | ||
pub fn load_config() -> Self { | ||
let mut file = std::fs::File::open(CONFIG_FILE).unwrap(); | ||
let mut content = String::new(); | ||
file.read_to_string(&mut content).unwrap(); | ||
toml::from_str(&content).unwrap() | ||
} | ||
|
||
// Returns the gateway | ||
pub fn gateway(&self) -> &str { | ||
&self.gateway | ||
} | ||
} |
Oops, something went wrong.