Skip to content

Example smart contract setup for mapping an end-user wallet to an ownable smart contract as its 'proxy wallet'.

Notifications You must be signed in to change notification settings

thirdweb-dev/proxy-contract-wallet-example

Repository files navigation

Smart accounts - example

This is an example of using 'smart accounts' -- smart contracts owned by an end-user wallet letting the user perform multiple actions to different contracts in a single transaction.

The end-user owned smart contract is src/SmartAccount.sol. This contract is a modified version of prb-proxy. (See changelog in the contract file).

The example flow can be found in src/test/SmartAccount.t.sol. The tests enact the following high level flow: the end user mints some ERC20 and ERC721 tokens (two actions on two different smart contracts) within a single transaction. The application developer or end user can choose whether the assets remain in the end-user owned/controlled smart contract wallet, or in the end-user's owned wallet.

How to run tests

The tests are written using the foundry/forge testing framework. All setup information for foundry/forge can be found here.

To run tests:

forge build

then:

forge test --match-contract SmartAccount

Authors

About

Example smart contract setup for mapping an end-user wallet to an ownable smart contract as its 'proxy wallet'.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published