TokenWithdrawalModule

Module for transferring ERC20, ERC721, and ERC1155 tokens for IP Accounts.

SECURITY RISK: An IPAccount can delegate to a frontend contract (not a registered module) to transfer tokens
on behalf of the IPAccount via the Token Management Module. This frontend contract can transfer any tokens that are
approved by the IPAccount for the Token Management Module. In other words, there's no mechanism for this module to
granularly control which token a caller (approved contract in this case) can transfer.

name

string name

Returns the string identifier associated with the module.

constructor

constructor(address accessController, address ipAccountRegistry) public

withdrawERC20

function withdrawERC20(address payable ipAccount, address tokenContract, uint256 amount) external

Withdraws ERC20 token from the IP account to the IP account owner.

When calling this function, the caller must have the permission to call transfer via the IP account.
Does not support transfer of multiple tokens at once.

Parameters

NameTypeDescription
ipAccountaddress payableThe IP account to transfer the ERC20 token from
tokenContractaddressThe address of the ERC20 token contract
amountuint256The amount of token to transfer

withdrawERC721

function withdrawERC721(address payable ipAccount, address tokenContract, uint256 tokenId) external

Withdraws ERC721 token from the IP account to the IP account owner.

When calling this function, the caller must have the permission to call transferFrom via the IP account.
Does not support batch transfers.

Parameters

NameTypeDescription
ipAccountaddress payableThe IP account to transfer the ERC721 token from
tokenContractaddressThe address of the ERC721 token contract
tokenIduint256The ID of the token to transfer

withdrawERC1155

function withdrawERC1155(address payable ipAccount, address tokenContract, uint256 tokenId, uint256 amount) external

Withdraws ERC1155 token from the IP account to the IP account owner.

When calling this function, the caller must have the permission to call safeTransferFrom via the IP
account.
Does not support batch transfers.

Parameters

NameTypeDescription
ipAccountaddress payableThe IP account to transfer the ERC1155 token from
tokenContractaddressThe address of the ERC1155 token contract
tokenIduint256The ID of the token to transfer
amountuint256The amount of token to transfer