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

Add smart contract wallet #413

Merged
merged 28 commits into from
Apr 16, 2024
Merged

Conversation

DOBEN
Copy link
Member

@DOBEN DOBEN commented Mar 14, 2024

Purpose

closes #412

Next: Update the CIS5 standard proposal document to match the reference implementation:
Concordium/concordium-update-proposals#60
e.g. the service fee is deposited to the public_key of the service fee recipient in this implementation to avoid too much dust amounts being sent to addresses.

Changes

Add smart contract wallet reference implementation.

@DOBEN DOBEN changed the title Add account abstracted smart contract wallet Add smart contract wallet Mar 22, 2024
@DOBEN DOBEN requested review from Bargsteen and limemloh and removed request for Bargsteen April 4, 2024 07:58
Copy link
Contributor

@Bargsteen Bargsteen left a comment

Choose a reason for hiding this comment

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

Nice work ;)

examples/cis2-multi/src/lib.rs Outdated Show resolved Hide resolved
examples/cis5-smart-contract-wallet/src/lib.rs Outdated Show resolved Hide resolved
examples/cis5-smart-contract-wallet/src/lib.rs Outdated Show resolved Hide resolved
examples/cis5-smart-contract-wallet/src/lib.rs Outdated Show resolved Hide resolved
examples/cis5-smart-contract-wallet/src/lib.rs Outdated Show resolved Hide resolved
examples/cis5-smart-contract-wallet/src/lib.rs Outdated Show resolved Hide resolved
examples/cis5-smart-contract-wallet/src/lib.rs Outdated Show resolved Hide resolved
examples/cis5-smart-contract-wallet/tests/tests.rs Outdated Show resolved Hide resolved
@DOBEN DOBEN requested a review from abizjak April 9, 2024 08:51
examples/cis2-multi/src/lib.rs Outdated Show resolved Hide resolved
examples/cis5-smart-contract-wallet/src/lib.rs Outdated Show resolved Hide resolved
examples/cis5-smart-contract-wallet/src/lib.rs Outdated Show resolved Hide resolved
examples/cis5-smart-contract-wallet/src/lib.rs Outdated Show resolved Hide resolved
examples/cis5-smart-contract-wallet/src/lib.rs Outdated Show resolved Hide resolved
examples/cis5-smart-contract-wallet/src/lib.rs Outdated Show resolved Hide resolved
examples/cis5-smart-contract-wallet/src/lib.rs Outdated Show resolved Hide resolved
@DOBEN
Copy link
Member Author

DOBEN commented Apr 11, 2024

I decided to change the from_address in the receiveHook function call in the cis2_multi contract. This chain seems to make more sense in terms of the token being moved from one address/public_key to another. The DepositCIs2TokensEvent is logged before the MintEvent but both events are in the same atomic transaction.

Event flow of depositing cis2 tokens into the smart contract wallet is as follows now:

MintEvent (in cis2_multi contract) -> to to_address
DepositCIs2TokensEvent (in smart_contract_wallet contract) -> from to_address to alice_public_key.

from: Address::from(address),

@DOBEN DOBEN requested a review from limemloh April 11, 2024 09:18
Copy link
Collaborator

@limemloh limemloh left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@DOBEN DOBEN force-pushed the account-abstracted-smart-contract-wallet branch from 6473fc0 to b6048ef Compare April 16, 2024 13:23
@DOBEN DOBEN force-pushed the account-abstracted-smart-contract-wallet branch from b6048ef to 4a67ac9 Compare April 16, 2024 13:27
@DOBEN DOBEN merged commit a932404 into main Apr 16, 2024
153 checks passed
@DOBEN DOBEN deleted the account-abstracted-smart-contract-wallet branch April 16, 2024 13:38
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.

Chaperone Smart Contract (Smart Contract Wallet Standard)
3 participants