-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add Bridge example #36
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First review to have more context.
Will take the time to run everything later in the day.
Good job on the makefiles and documentation though.
let token_dispatcher = IERC20BridgeableDispatcher { contract_address: data.l2_token }; | ||
token_dispatcher.burn(caller, amount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When messaging is involved, I would opt for escrow over burning directly. If anything goes wrong in the process, reverting an escrow is not affecting the liquidity the same way as burning/minting tokens.
But the escrow definitely adds more logic to handle, so having a process to mint them again is perhaps completely fine in this scenario.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tokens are escrowed on L1 & mint/ burn on L2 & total_supply remains constant
fn l2_bridge_address(self: @TState,) -> ContractAddress; | ||
fn mint(ref self: TState, recipient: ContractAddress, amount: u256); | ||
|
||
// WITHOUT INTERFACE !!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is codegen it just say next fn are not included in another interface
https://github.com/notV4l/origami/blob/bridge_exemple/token/scripts/genInterface.js
it generate interface from artifact (i used it when composing components to check exposed fn)
maybe cainome could handle this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, if we could centralize codegen it could be awesome. With cainome, when plugin with stdin are supported, you have in fact a list of organized tokens instead of parsing the raw ABI that can be easily used to such tasks.
But I think that for now it's fine using this script to not delay this PR as tt's a specific use case which we have to see how it can be integrated in cainome for easy use.
Something like this from a rust code:
let trait_string = AbiParser::abi_to_trait("TraitName", manifest.abi);
defc4ee
to
e570e9e
Compare
@@ -0,0 +1,14 @@ | |||
## DOJO BRIDGE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## DOJO BRIDGE | |
## Dojo Bridge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should use submodules and no embed these
use token::components::security::initializable::initializable_component; | ||
|
||
use token::components::token::erc20::erc20_metadata::erc20_metadata_component; | ||
use token::components::token::erc20::erc20_balance::erc20_balance_component; | ||
use token::components::token::erc20::erc20_allowance::erc20_allowance_component; | ||
use token::components::token::erc20::erc20_mintable::erc20_mintable_component; | ||
use token::components::token::erc20::erc20_burnable::erc20_burnable_component; | ||
use token::components::token::erc20::erc20_bridgeable::erc20_bridgeable_component; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use token::components::security::initializable::initializable_component; | |
use token::components::token::erc20::erc20_metadata::erc20_metadata_component; | |
use token::components::token::erc20::erc20_balance::erc20_balance_component; | |
use token::components::token::erc20::erc20_allowance::erc20_allowance_component; | |
use token::components::token::erc20::erc20_mintable::erc20_mintable_component; | |
use token::components::token::erc20::erc20_burnable::erc20_burnable_component; | |
use token::components::token::erc20::erc20_bridgeable::erc20_bridgeable_component; | |
use token::components::{ | |
security::initializable::initializable_component, | |
token::erc20::{ | |
erc20_metadata::erc20_metadata_component, | |
erc20_balance::erc20_balance_component, | |
erc20_allowance::erc20_allowance_component, | |
erc20_mintable::erc20_mintable_component, | |
erc20_burnable::erc20_burnable_component, | |
erc20_bridgeable::erc20_bridgeable_component, | |
}, | |
}; |
@notV4l could you finish these last few tasks |
No description provided.