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

Allow twin to bond with a stash address #636

Closed
DylanVerstraete opened this issue Mar 10, 2023 · 1 comment
Closed

Allow twin to bond with a stash address #636

DylanVerstraete opened this issue Mar 10, 2023 · 1 comment
Assignees
Labels
type_feature New feature or request

Comments

@DylanVerstraete
Copy link
Contributor

Allow a twin specify an address that is his "savings account", the savings account should initiate the bond between a twin and that address.

  • Add twin_bonded_account optional storage map which maps a twin_id to a savings account
  • Add bond method on pallet-tfgrid where the twin_id and savings account are inserted into the storage

In the pallet smart contract when we calculate the discount we can check if the twin has a bonded account and check if a discount can be applied based on the TFT's on that bonded account.

@DylanVerstraete DylanVerstraete added the type_feature New feature or request label Mar 10, 2023
@DylanVerstraete DylanVerstraete added this to the 2.4.0 milestone Mar 10, 2023
@renauter renauter self-assigned this Mar 10, 2023
@mohamedamer453
Copy link

Verified on devnet.

bondTwinAccount(twinId) extrinsic was added in the tfgridmodule and i tried to bind my twin 39 to my other twin 60 and it worked.

image

And from chain state i used twinBoundedAccountID(u32): Option<AccountId32> and indeed it returned the address of twin 39.

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type_feature New feature or request
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants