This repository contains A3SWalletFactory and A3SWallet smart contracts.
A3SWalletFactory is adjusted based on OpenZeppelin's ERC721 implementation. We provide the mintWallet function so that users can create a tradable A3SWallet contract address through this function.
Parameters
to: the address you want to assign the minted wallet to salt: 32 bytes of input to determine the generated wallet address, each salt can only be used once useFiatToken: if true, we will charge specified token as fee, else we will charge ether as fee
A3SWallet provide two main functions, transferEther and generalCall.
Responsible for handling wallet transfers or withdrawals.
Parameters
to: recipient address, you can withdraw ethers with given your target wallet address amount: number of ethers you want to transfer out from current wallet
Responsible for handling interactions with any other contract, the user must provide the target contract address and the corresponding function payload.
Parameters
contractAddress: target address you want to interact with payload: encoded functino call with parameters and basic infosThe contract functino payload can be calculated by web3.eth.abi.encodeFunctionCall from web3js
Example:
// ERC20 transfer funcion abi example let payload = await hre.web3.eth.abi.encodeFunctionCall( { name: "transfer", type: "function", inputs: [ { type: "address", name: "to", }, { type: "uint256", name: "amount", }, ], outputs: [ { type: "bool", name: "nopr", }, ], }, [address, "20"] );