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

Sovereign-Forge SC #185

merged 31 commits into from
Nov 20, 2024

Conversation

andreiblt1304
Copy link
Contributor

Created the Sovereign-Forge SC that will call the Chain-Factory SC. Basically this contract will be the user's interaction with the Sovereign Chain in order to deploy and setup the needed modules and SCs. This PR contains the following:

  • The newly generated Sovereign-Forge along side it's common modules: Utils and Storage
  • The Phases module will call the endpoints from the Chain-Factory SC and deploy the needed contracts in phases

Signed-off-by: Andrei Baltariu <[email protected]>
Signed-off-by: Andrei Baltariu <[email protected]>
Signed-off-by: Andrei Baltariu <[email protected]>
Signed-off-by: Andrei Baltariu <[email protected]>
Signed-off-by: Andrei Baltariu <[email protected]>
Signed-off-by: Andrei Baltariu <[email protected]>
Signed-off-by: Andrei Baltariu <[email protected]>
Signed-off-by: Andrei Baltariu <[email protected]>
Signed-off-by: Andrei Baltariu <[email protected]>
Signed-off-by: Andrei Baltariu <[email protected]>
Signed-off-by: Andrei Baltariu <[email protected]>
Signed-off-by: Andrei Baltariu <[email protected]>
Signed-off-by: Andrei Baltariu <[email protected]>
Signed-off-by: Andrei Baltariu <[email protected]>
Copy link

github-actions bot commented Nov 19, 2024

Coverage Summary

Totals

Count Covered %
Lines 8639 3475 40.22
Regions 2366 644 27.22
Functions 913 314 34.39
Instantiations 2923 656 22.44

Files

Expand
File Lines Regions Functions Instantiations
/chain-config/meta/src/main.rs 0.00% 0.00% 0.00% 0.00%
/chain-config/src/bridge.rs 0.00% 0.00% 0.00% 0.00%
/chain-config/src/lib.rs 100.00% 100.00% 100.00% 16.67%
/chain-config/src/validator_rules.rs 50.00% 26.32% 50.00% 18.03%
/chain-factory/meta/src/main.rs 0.00% 0.00% 0.00% 0.00%
/chain-factory/src/factory.rs 32.79% 42.86% 40.00% 17.74%
/chain-factory/src/lib.rs 100.00% 100.00% 100.00% 26.32%
/chain-factory/tests/chain_factory_tests.rs 97.25% 88.89% 100.00% 100.00%
/common/bls-signature/src/lib.rs 2.50% 9.09% 16.67% 3.60%
/common/max-bridged-amount-module/src/lib.rs 76.92% 62.50% 75.00% 22.86%
/common/proxies/src/chain_config_proxy.rs 18.24% 6.90% 10.00% 12.50%
/common/proxies/src/chain_factory_proxy.rs 39.82% 37.50% 37.50% 42.86%
/common/proxies/src/enshrine_esdt_safe_proxy.rs 36.77% 33.33% 33.33% 20.00%
/common/proxies/src/esdt_safe_proxy.rs 20.99% 21.21% 21.21% 19.51%
/common/proxies/src/fee_market_proxy.rs 40.76% 27.45% 35.71% 28.75%
/common/proxies/src/header_verifier_proxy.rs 63.03% 60.00% 60.00% 56.41%
/common/proxies/src/token_handler_proxy.rs 83.33% 80.00% 80.00% 63.16%
/common/setup-phase/src/lib.rs 31.82% 50.00% 50.00% 16.22%
/common/token-whitelist/src/lib.rs 26.67% 31.25% 50.00% 15.62%
/common/transaction/src/lib.rs 60.45% 40.15% 46.97% 38.35%
/common/transaction/src/transaction_status.rs 0.00% 0.00% 0.00% 0.00%
/common/tx-batch-module/src/batch_status.rs 0.00% 0.00% 0.00% 0.00%
/common/tx-batch-module/src/lib.rs 4.55% 6.85% 18.75% 5.06%
/common/tx-batch-module/src/tx_batch_mapper.rs 0.00% 0.00% 0.00% 0.00%
/common/utils/src/lib.rs 81.25% 67.74% 80.00% 23.38%
/enshrine-esdt-safe/interactor/src/config.rs 0.00% 0.00% 0.00% 0.00%
/enshrine-esdt-safe/interactor/src/interactor_main.rs 0.00% 0.00% 0.00% 0.00%
/enshrine-esdt-safe/meta/src/main.rs 0.00% 0.00% 0.00% 0.00%
/enshrine-esdt-safe/src/common/storage.rs 100.00% 66.67% 100.00% 26.32%
/enshrine-esdt-safe/src/from_sovereign/events.rs 100.00% 66.67% 100.00% 16.67%
/enshrine-esdt-safe/src/from_sovereign/transfer_tokens.rs 90.08% 82.35% 83.33% 32.56%
/enshrine-esdt-safe/src/lib.rs 91.43% 82.35% 100.00% 24.07%
/enshrine-esdt-safe/src/to_sovereign/create_tx.rs 95.41% 93.75% 100.00% 34.29%
/enshrine-esdt-safe/src/to_sovereign/events.rs 100.00% 66.67% 100.00% 16.67%
/enshrine-esdt-safe/tests/enshrine_esdt_safe_blackbox_test.rs 99.88% 98.53% 100.00% 100.00%
/esdt-safe/interactor/src/interactor_main.rs 0.00% 0.00% 0.00% 0.00%
/esdt-safe/interactor/src/proxies/fee_market_proxy.rs 0.00% 0.00% 0.00% 0.00%
/esdt-safe/interactor/src/proxies/header_verifier_proxy.rs 0.00% 0.00% 0.00% 0.00%
/esdt-safe/interactor/src/proxies/price_aggregator_proxy.rs 0.00% 0.00% 0.00% 0.00%
/esdt-safe/interactor/src/proxies/proxy.rs 0.00% 0.00% 0.00% 0.00%
/esdt-safe/interactor/src/proxies/testing_sc_proxy.rs 0.00% 0.00% 0.00% 0.00%
/esdt-safe/meta/src/main.rs 0.00% 0.00% 0.00% 0.00%
/esdt-safe/src/from_sovereign/events.rs 100.00% 66.67% 100.00% 16.67%
/esdt-safe/src/from_sovereign/token_mapping.rs 1.10% 5.41% 5.26% 5.71%
/esdt-safe/src/from_sovereign/transfer_tokens.rs 41.63% 50.00% 75.00% 31.91%
/esdt-safe/src/lib.rs 76.47% 75.00% 66.67% 16.67%
/esdt-safe/src/to_sovereign/create_tx.rs 45.51% 50.94% 62.50% 22.86%
/esdt-safe/src/to_sovereign/events.rs 100.00% 66.67% 100.00% 16.67%
/esdt-safe/tests/bridge_blackbox_tests.rs 86.54% 93.10% 92.00% 92.00%
/fee-market/meta/src/main.rs 0.00% 0.00% 0.00% 0.00%
/fee-market/src/fee_common.rs 100.00% 75.00% 100.00% 29.17%
/fee-market/src/fee_type.rs 85.29% 53.66% 64.29% 29.76%
/fee-market/src/lib.rs 66.67% 85.71% 66.67% 26.79%
/fee-market/src/price_aggregator.rs 0.00% 0.00% 0.00% 0.00%
/fee-market/src/subtract_fee.rs 42.86% 37.50% 43.75% 17.74%
/fee-market/tests/fee_market_blackbox_test.rs 91.30% 88.64% 100.00% 100.00%
/header-verifier/meta/src/main.rs 0.00% 0.00% 0.00% 0.00%
/header-verifier/src/lib.rs 92.21% 91.18% 91.67% 52.42%
/header-verifier/tests/header_verifier_blackbox_test.rs 100.00% 100.00% 100.00% 100.00%
/sovereign-forge/meta/src/main.rs 0.00% 0.00% 0.00% 0.00%
/sovereign-forge/src/common/storage.rs 0.00% 0.00% 0.00% 0.00%
/sovereign-forge/src/common/utils.rs 0.00% 0.00% 0.00% 0.00%
/sovereign-forge/src/lib.rs 0.00% 0.00% 0.00% 0.00%
/sovereign-forge/src/phases.rs 0.00% 0.00% 0.00% 0.00%
/testing-sc/meta/src/main.rs 0.00% 0.00% 0.00% 0.00%
/testing-sc/src/lib.rs 0.00% 0.00% 0.00% 0.00%
/token-handler/meta/src/main.rs 0.00% 0.00% 0.00% 0.00%
/token-handler/src/common_storage.rs 100.00% 50.00% 100.00% 21.05%
/token-handler/src/lib.rs 100.00% 100.00% 100.00% 27.91%
/token-handler/src/transfer_tokens.rs 50.52% 36.67% 66.67% 30.30%
/token-handler/tests/token_handler_blackbox_tests.rs 94.82% 95.24% 100.00% 100.00%
/token-handler/tests/token_handler_scenario_rs_test.rs 0.00% 0.00% 0.00% 0.00%

Copy link

github-actions bot commented Nov 19, 2024

Contract comparison - from cff6c8a to 60ba9f8

Path                                                                                             size                  has-allocator                     has-format
chain-config-full.wasm 5494 ➡️ 5541 🔴 false without message
chain-config-view.wasm 626 false None
chain-config.wasm 5494 ➡️ 5541 🔴 false without message
enshrine-esdt-safe-full.wasm 28273 ➡️ 28274 🔴 false without message
enshrine-esdt-safe-view.wasm 626 false None
enshrine-esdt-safe.wasm 28274 false without message
esdt-safe.wasm 28651 ➡️ 28650 🟢 false without message
esdt-safe-view.wasm 626 false None
esdt-safe-full.wasm 28651 false without message
testing-sc.wasm 461 false None
testing-view.wasm 626 false None
testing-sc-full.wasm 461 false None
fee-market.wasm 12093 false without message
fee-market-view.wasm 626 false None
chain-factory-full.wasm 5421 ➡️ 5507 🔴 false without message
chain-factory-view.wasm 626 false None
chain-factory.wasm 5421 ➡️ 5507 🔴 false without message
header-verifier-full.wasm 5584 false without message
header-verifier.wasm 5584 false without message
multisig-view.wasm 626 false None
token-handler-view.wasm 626 false None
token-handler-full.wasm 9359 false without message
token-handler.wasm 9359 false without message

sovereign-forge/src/lib.rs Outdated Show resolved Hide resolved
sovereign-forge/src/lib.rs Outdated Show resolved Hide resolved
sovereign-forge/src/lib.rs Outdated Show resolved Hide resolved
sovereign-forge/src/lib.rs Outdated Show resolved Hide resolved
fn sovereigns_mapper(
&self,
sovereign_creator: &ManagedAddress,
) -> SingleValueMapper<ChainContractsMap<Self::Api>>;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking we will need to change this mapper later, but I'm not sure.

  • maybe we want to display all sovereign chains somewhere without knowing the owners
  • also, we will need a way to access all esdt-safe addresses. These are required for explorer to display "cross-chain tx" icon correctly for transactions

For the moment we can keep it SingleValueMapper.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO for different PR

  • define a "complete setup phase" for this contract where we check token-handlers and chain-factory storages are set
  • only if the setup is completed, deploy_phase_one can be called

sovereign-forge/src/phases.rs Show resolved Hide resolved
sovereign-forge/src/lib.rs Show resolved Hide resolved
sovereign-forge/src/lib.rs Show resolved Hide resolved
sovereign-forge/src/phases.rs Outdated Show resolved Hide resolved
andreiblt1304 and others added 2 commits November 20, 2024 10:09
Signed-off-by: Andrei Baltariu <[email protected]>
@andreiblt1304 andreiblt1304 merged commit 2a7019a into feat/sovereign-forge Nov 20, 2024
7 checks passed
@andreiblt1304 andreiblt1304 deleted the forge-deploy-config branch December 3, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants