Skip to content

Commit

Permalink
Merge pull request #178 from multiversx/feat/enshrine-esdt
Browse files Browse the repository at this point in the history
`feat/enshrine` merge into `feat/beta`
  • Loading branch information
sasurobert authored Nov 15, 2024
2 parents 6018b7a + 5c5601c commit 8d053a4
Show file tree
Hide file tree
Showing 90 changed files with 7,646 additions and 1,735 deletions.
38 changes: 38 additions & 0 deletions Cargo.lock

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

8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[workspace]
resolver = "2"

members = [
"chain-config",
"chain-config/meta",
Expand All @@ -8,10 +9,15 @@ members = [
"esdt-safe",
"esdt-safe/interactor",
"esdt-safe/meta",
"esdt-safe/interactor",
"fee-market",
"fee-market/meta",
"header-verifier",
"header-verifier/meta",
"enshrine-esdt-safe",
"enshrine-esdt-safe/meta"
"enshrine-esdt-safe/meta",
"token-handler",
"token-handler/meta",
"testing-sc",
"testing-sc/meta",
]
22 changes: 22 additions & 0 deletions chain-factory/sc-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[settings]
main = "main"

[contracts.main]
name = "chain-factory"

[contracts.full]
name = "chain-factory-full"
add-unlabelled = true
add-labels = ["chain-factory-external-view"]

[contracts.view]
name = "chain-factory-view"
external-view = true
add-unlabelled = false
add-labels = ["chain-factory-external-view"]

[[proxy]]
path = "src/chain_factory_proxy.rs"

[[proxy]]
path = "../token-handler/src/chain_factory_proxy.rs"
204 changes: 204 additions & 0 deletions chain-factory/src/chain_factory_proxy.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
// Code generated by the multiversx-sc proxy generator. DO NOT EDIT.

////////////////////////////////////////////////////
////////////////// AUTO-GENERATED //////////////////
////////////////////////////////////////////////////

#![allow(dead_code)]
#![allow(clippy::all)]

use multiversx_sc::proxy_imports::*;

pub struct ChainFactoryContractProxy;

impl<Env, From, To, Gas> TxProxyTrait<Env, From, To, Gas> for ChainFactoryContractProxy
where
Env: TxEnv,
From: TxFrom<Env>,
To: TxTo<Env>,
Gas: TxGas<Env>,
{
type TxProxyMethods = ChainFactoryContractProxyMethods<Env, From, To, Gas>;

fn proxy_methods(self, tx: Tx<Env, From, To, (), Gas, (), ()>) -> Self::TxProxyMethods {
ChainFactoryContractProxyMethods { wrapped_tx: tx }
}
}

pub struct ChainFactoryContractProxyMethods<Env, From, To, Gas>
where
Env: TxEnv,
From: TxFrom<Env>,
To: TxTo<Env>,
Gas: TxGas<Env>,
{
wrapped_tx: Tx<Env, From, To, (), Gas, (), ()>,
}

#[rustfmt::skip]
impl<Env, From, Gas> ChainFactoryContractProxyMethods<Env, From, (), Gas>
where
Env: TxEnv,
Env::Api: VMApi,
From: TxFrom<Env>,
Gas: TxGas<Env>,
{
pub fn init<
Arg0: ProxyArg<ManagedAddress<Env::Api>>,
Arg1: ProxyArg<ManagedAddress<Env::Api>>,
Arg2: ProxyArg<BigUint<Env::Api>>,
>(
self,
validators_contract_address: Arg0,
chain_config_template: Arg1,
deploy_cost: Arg2,
) -> TxTypedDeploy<Env, From, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_deploy()
.argument(&validators_contract_address)
.argument(&chain_config_template)
.argument(&deploy_cost)
.original_result()
}
}

#[rustfmt::skip]
impl<Env, From, To, Gas> ChainFactoryContractProxyMethods<Env, From, To, Gas>
where
Env: TxEnv,
Env::Api: VMApi,
From: TxFrom<Env>,
To: TxTo<Env>,
Gas: TxGas<Env>,
{
pub fn upgrade(
self,
) -> TxTypedUpgrade<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_upgrade()
.original_result()
}
}

#[rustfmt::skip]
impl<Env, From, To, Gas> ChainFactoryContractProxyMethods<Env, From, To, Gas>
where
Env: TxEnv,
Env::Api: VMApi,
From: TxFrom<Env>,
To: TxTo<Env>,
Gas: TxGas<Env>,
{
pub fn deploy_sovereign_chain_config_contract<
Arg0: ProxyArg<usize>,
Arg1: ProxyArg<usize>,
Arg2: ProxyArg<BigUint<Env::Api>>,
Arg3: ProxyArg<MultiValueEncoded<Env::Api, MultiValue2<TokenIdentifier<Env::Api>, BigUint<Env::Api>>>>,
>(
self,
min_validators: Arg0,
max_validators: Arg1,
min_stake: Arg2,
additional_stake_required: Arg3,
) -> TxTypedCall<Env, From, To, (), Gas, ()> {
self.wrapped_tx
.raw_call("deploySovereignChainConfigContract")
.argument(&min_validators)
.argument(&max_validators)
.argument(&min_stake)
.argument(&additional_stake_required)
.original_result()
}

pub fn blacklist_sovereign_chain_sc<
Arg0: ProxyArg<ManagedAddress<Env::Api>>,
>(
self,
sc_address: Arg0,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("blacklistSovereignChainSc")
.argument(&sc_address)
.original_result()
}

pub fn deploy_cost(
self,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, BigUint<Env::Api>> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("getDeployCost")
.original_result()
}

pub fn slash<
Arg0: ProxyArg<ManagedAddress<Env::Api>>,
Arg1: ProxyArg<BigUint<Env::Api>>,
>(
self,
validator_address: Arg0,
value: Arg1,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("slash")
.argument(&validator_address)
.argument(&value)
.original_result()
}

pub fn distribute_slashed<
Arg0: ProxyArg<MultiValueEncoded<Env::Api, MultiValue2<ManagedAddress<Env::Api>, BigUint<Env::Api>>>>,
>(
self,
dest_amount_pairs: Arg0,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("distributeSlashed")
.argument(&dest_amount_pairs)
.original_result()
}

pub fn set_min_valid_signers<
Arg0: ProxyArg<u32>,
>(
self,
new_value: Arg0,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("setMinValidSigners")
.argument(&new_value)
.original_result()
}

pub fn add_signers<
Arg0: ProxyArg<MultiValueEncoded<Env::Api, ManagedAddress<Env::Api>>>,
>(
self,
signers: Arg0,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("addSigners")
.argument(&signers)
.original_result()
}

pub fn remove_signers<
Arg0: ProxyArg<MultiValueEncoded<Env::Api, ManagedAddress<Env::Api>>>,
>(
self,
signers: Arg0,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("removeSigners")
.argument(&signers)
.original_result()
}
}
Loading

0 comments on commit 8d053a4

Please sign in to comment.