Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sovereign-Forge SC #185

Merged
merged 31 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2e7c162
Generated new `sovereign-forge` contract
andreiblt1304 Nov 18, 2024
bab71ec
Merge branch 'feat/beta' into feat/sovereign-forge
andreiblt1304 Nov 18, 2024
f046620
Built contract
andreiblt1304 Nov 18, 2024
4a5e6e0
Added modules
andreiblt1304 Nov 19, 2024
b0943b1
Added `chain-id` generation
andreiblt1304 Nov 19, 2024
ad49eee
Added `deploy-cost`
andreiblt1304 Nov 19, 2024
56b1468
Added sc-config
andreiblt1304 Nov 19, 2024
8df79e0
Created common module
andreiblt1304 Nov 19, 2024
335ff3b
Moved type alias to `common` module
andreiblt1304 Nov 19, 2024
9630f79
Added endpoints to register token-handler and chain-factory addresses
andreiblt1304 Nov 19, 2024
8f7b13e
Added token-handler and chain-factory addresses mappers
andreiblt1304 Nov 19, 2024
4fa75fe
Modified validator size to be `u64`
andreiblt1304 Nov 19, 2024
332ec0d
Added `new()` function for the custom structs
andreiblt1304 Nov 19, 2024
2617cac
Added variable for blockchain wrapper
andreiblt1304 Nov 19, 2024
88d9205
Added endpoint for chain_factory call
andreiblt1304 Nov 19, 2024
65f86fb
Added common transaction module dependency
andreiblt1304 Nov 19, 2024
228b3d6
Sovereign-forge proxy
andreiblt1304 Nov 19, 2024
04c4bf7
Built contracts
andreiblt1304 Nov 19, 2024
9131f0b
Made `charset` a constant
andreiblt1304 Nov 19, 2024
f5c03d1
Whitespaces
andreiblt1304 Nov 19, 2024
d633ba5
Modified existance of Sovereign Chain condition
andreiblt1304 Nov 19, 2024
036966b
Fixed tests
andreiblt1304 Nov 19, 2024
e21695b
Removed scenario tests
andreiblt1304 Nov 19, 2024
0a2e10c
Modified endpoints to use `shard_id` as argument
andreiblt1304 Nov 19, 2024
fcd1581
Added require + proxy regen
andreiblt1304 Nov 19, 2024
b6361a5
Added formated `require!` error message
andreiblt1304 Nov 19, 2024
8b5561b
Update sovereign-forge/src/phases.rs
andreiblt1304 Nov 20, 2024
817e0ef
Fw-upgrade to 0.54.3
andreiblt1304 Nov 20, 2024
f1f3703
Merge pull request #186 from multiversx/beta-fw-upgrade
andreiblt1304 Nov 20, 2024
9c2a942
Merge branch 'feat/beta' into forge-deploy-config
andreiblt1304 Nov 20, 2024
60ba9f8
Upgraded sovereign-forge to last fw version
andreiblt1304 Nov 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 34 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ members = [
"token-handler/meta",
"testing-sc",
"testing-sc/meta",
"sovereign-forge",
"sovereign-forge/meta",
]
9 changes: 6 additions & 3 deletions chain-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ path = "src/lib.rs"
num-bigint = "0.4.2"

[dev-dependencies.multiversx-sc-scenario]
version = "=0.54.2"
version = "=0.54.3"

[dependencies.multiversx-sc]
version = "=0.54.2"
version = "=0.54.3"

[dependencies.multiversx-sc-modules]
version = "=0.54.2"
version = "=0.54.3"

[dependencies.transaction]
path = "../common/transaction"
2 changes: 1 addition & 1 deletion chain-config/meta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ authors = ["you"]
path = ".."

[dependencies.multiversx-sc-meta-lib]
version = "=0.54.2"
version = "=0.54.3"
7 changes: 3 additions & 4 deletions chain-config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
#![no_std]

use multiversx_sc_modules::only_admin;
use transaction::StakeMultiArg;
use validator_rules::TokenIdAmountPair;

multiversx_sc::imports!();

pub mod bridge;
pub mod validator_rules;

pub type StakeMultiArg<M> = MultiValue2<TokenIdentifier<M>, BigUint<M>>;

#[multiversx_sc::contract]
pub trait ChainConfigContract:
bridge::BridgeModule + validator_rules::ValidatorRulesModule + only_admin::OnlyAdminModule
{
#[init]
fn init(
&self,
min_validators: usize,
max_validators: usize,
min_validators: u64,
max_validators: u64,
min_stake: BigUint,
admin: ManagedAddress,
additional_stake_required: MultiValueEncoded<StakeMultiArg<Self::Api>>,
Expand Down
4 changes: 2 additions & 2 deletions chain-config/src/validator_rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ pub struct TokenIdAmountPair<M: ManagedTypeApi> {
pub trait ValidatorRulesModule {
#[view(getMinValidators)]
#[storage_mapper("minValidators")]
fn min_validators(&self) -> SingleValueMapper<usize>;
fn min_validators(&self) -> SingleValueMapper<u64>;

#[view(getMaxValidators)]
#[storage_mapper("maxValidators")]
fn max_validators(&self) -> SingleValueMapper<usize>;
fn max_validators(&self) -> SingleValueMapper<u64>;

// TODO: Read user stake and verify
#[view(getMinStake)]
Expand Down
24 changes: 16 additions & 8 deletions chain-config/wasm-chain-config-full/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion chain-config/wasm-chain-config-full/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ panic = "abort"
path = ".."

[dependencies.multiversx-sc-wasm-adapter]
version = "=0.54.2"
version = "=0.54.3"

[workspace]
members = ["."]
24 changes: 16 additions & 8 deletions chain-config/wasm-chain-config-view/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion chain-config/wasm-chain-config-view/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ panic = "abort"
path = ".."

[dependencies.multiversx-sc-wasm-adapter]
version = "=0.54.2"
version = "=0.54.3"

[workspace]
members = ["."]
Loading
Loading