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

Mapping func/subxt #4

Merged
merged 29 commits into from
Jun 11, 2024
Merged

Mapping func/subxt #4

merged 29 commits into from
Jun 11, 2024

Conversation

ocdbytes
Copy link
Member

  • added genesis state declarations.
  • updated with declareV0 call.
  • updated the tests.

@ocdbytes ocdbytes requested a review from apoorvsadana June 10, 2024 12:51
Readme.md Outdated
the **Token Bridge** & **Eth Bridge** contract
between a madara/katana appchain and
another L2 or L1 network. It will also declare wallet
contracts from **OpenZappeline**, **Argent** and
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
contracts from **OpenZappeline**, **Argent** and
contracts from **OpenZeppelin**, **Argent** and

Copy link
Contributor

Choose a reason for hiding this comment

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

not fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

can delete this

Copy link
Contributor

Choose a reason for hiding this comment

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

let's remove this file and break it to smaller parts as discusssed


let deploy_tx = account

let token_bridge_class_hash = declare_contract_middleware(DeclarationInput::DeclarationInputs(
Copy link
Contributor

Choose a reason for hiding this comment

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

this isn't really a middleware, more like a util

Copy link
Contributor

Choose a reason for hiding this comment

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

we can delete this

Readme.md Outdated
Comment on lines 3 to 9
Madara Bootstarp is a tool that helps to deploy
the **Token Bridge** & **Eth Bridge** contract
between a madara/katana appchain and
another L2 or L1 network. It will also declare wallet
contracts from **OpenZappelin**, **Argent** and
**Braavos**. You can find the full list of contracts
in [Info](#info-ℹ)
Copy link
Contributor

Choose a reason for hiding this comment

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

the number of words per line seem to be very low no?

Readme.md Outdated
the **Token Bridge** & **Eth Bridge** contract
between a madara/katana appchain and
another L2 or L1 network. It will also declare wallet
contracts from **OpenZappeline**, **Argent** and
Copy link
Contributor

Choose a reason for hiding this comment

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

not fixed

save_to_json("l2_eth_address", &JsonValueType::StringType(eth_address.to_string()))?;
log::info!("L2 ETH Token Deployment Successful [✅]");
log::info!("[🚀] L2 ETH Token Address : {:?}", eth_address);
// save_to_json("l2_eth_address", &JsonValueType::StringType(eth_address.to_string()))?;
Copy link
Contributor

Choose a reason for hiding this comment

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

does this need to be commented?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

src/main.rs Outdated
pub l2_erc20_token_address: FieldElement,
}

pub async fn deploy_bridges(config: &CliArgs) -> DeployBridgeOutput {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pub async fn deploy_bridges(config: &CliArgs) -> DeployBridgeOutput {
pub async fn bootstrap(config: &CliArgs) -> DeployBridgeOutput {

Comment on lines 17 to 25
# markdown-lint:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: avto-dev/markdown-lint@v1
# with:
# config: "./.markdownlint.json"
# args: "."
# ignore: "./target"
Copy link
Contributor

Choose a reason for hiding this comment

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

let's uncomment this?

rpc,
signer,
account_address,
FieldElement::from_hex_be("0x4d4144415241").unwrap(),
Copy link
Contributor

Choose a reason for hiding this comment

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

we shouldn't hardcode this

}

#[allow(private_interfaces)]
pub async fn declare_contract_util_func(input: DeclarationInput<'_>) -> FieldElement {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pub async fn declare_contract_util_func(input: DeclarationInput<'_>) -> FieldElement {
pub async fn declare_contract(input: DeclarationInput<'_>) -> FieldElement {

use crate::utils::{convert_to_hex, save_to_json, JsonValueType};
use crate::CliArgs;

pub async fn account_init_func<'a>(clients: &'a Config, arg_config: &'a CliArgs) -> RpcAccount<'a> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pub async fn account_init_func<'a>(clients: &'a Config, arg_config: &'a CliArgs) -> RpcAccount<'a> {
pub async fn account_init<'a>(clients: &'a Config, arg_config: &'a CliArgs) -> RpcAccount<'a> {

let braavos_class_hash = declare_contract_util_func(DeclarationInput::DeclarationInputs(
String::from(BRAAVOS_ACCOUNT_SIERRA_PATH),
String::from(BRAAVOS_ACCOUNT_CASM_PATH),
self.account.clone(),
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to clone, can we pass a ref?

Copy link
Member Author

Choose a reason for hiding this comment

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

we can't gives error. If it would be possible clippy me aa jaega

@ocdbytes ocdbytes merged commit c4aee7e into main Jun 11, 2024
5 checks passed
@ocdbytes ocdbytes deleted the mapping-func/subxt branch August 6, 2024 12:30
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.

2 participants