PSI Launchpad - Smart Contract Audit Report

Summary

 PSILaunchpad Audit Report Passive Income is building a new launchpad for projects to launch crowdsale campaigns in a safe, trusted, and decentralized manner.

We reviewed Passive Income's PSIPadCampaignFactory, PSIPadTokenDeployer, PSIPadTokenLockFactory, PSIPadTokenModel, Token, and TokenAnyswap contracts at commit bfb056c7c278cf5cfd123469e367983c9a0e8141 on the team's private Github repository.

We previously reviewed the project team's PassiveIncome token contract here.

Notes on Individual Contracts:
PSIPadCampaignFactory contracts:
  • Anyone can use the PSIPadCampaignFactory contract to create a new PSIPadCampaign for a token of their choice; the user can specify an address to be the owner of the Campaign, or can be the owner themselves.
  • The platform assists the Campaign owner in transferring the Campaign tokens to the Campaign address itself, as well as the amount of fee tokens required.
  • While a Campaign is live, anyone is able to deposit ETH (up to a certain limit) in order to buy the Campaign tokens at a rate determined by the owner of the Campaign.
  • The Campaign owner is able to lock the Campaign only if it is not live and the campaign has not failed.
  • Upon locking, liquidity may be added by pairing the ETH collected as fees (if any) with a portion of the campaign tokens taken as fees, and adding it as liquidity to the ETH pair.
  • The remaining fee tokens and ETH are sent to the Fee Aggregator address controlled by the project team.
  • While the Campaign is locked, anyone is able to withdraw their purchased tokens based on how much ETH they deposited during the campaign, as long as the Campaign has not failed.
  • The team must exercise caution and must not allow ERC777-compliant tokens to be Campaign tokens, or withdrawing the Campaign tokens can be vulnerable to re-entrancy attacks.
  • The Campaign owner is able to unlock the Campaign only once, given it has not failed and the unlock date has passed; any LP tokens as well as any Campaign tokens in the contract are transferred to the Campaign owner.
  • In the event that the Campaign has failed, users are able to withdraw their deposited funds and the Campaign owner is able to withdraw the Campaign tokens.
  • The Campaign owner is able to set the LP address to any address only if the Campaign is locked, it has not failed, and it is able to be unlocked.
  • The owner of the PSIPadCampaignFactory contract is able to set the Factory address, the Router address, the Fee Aggregator address, the WETH address, the ETH fee, the Campaign Token fee, and the Clone address to any values at any time.
PSIPadTokenDeployer contract:
  • Anyone can use this contract to pay a fee in ETH and create a new token of type Base or BaseAnySwap; the BaseAnySwap type allows for cross-chain functionality.
  • The user is able to choose various token characteristics, such as the name, symbol, initial supply, maximum supply, burnable, mintable, minter delay time, underlying asset address, and vault address.
  • The owner is able to set the Fee Aggregator and the WETH contract address to any address at any time.
  • The owner is able to set the ETH fee to any value at any time.
  • The owner is able to set the implementation address for any token type to any value at any time.
PSIPadTokenLockFactory contract:
  • Anyone can use this contract to lock any amount of any token for any duration; the user can also specify the number of releases, which are evenly placed throughout the duration.
  • The user must pay a fee in ETH in order to lock tokens.
  • The owner of the lock is able to transfer the ownership of the lock to any address at any time.
  • The owner of the lock is able to unlock and withdraw any amount of funds when they become available.
  • The owner of the contract is able to set the Fee Aggregator and the WETH contract address to any address at any time.
  • The owner of the contract is able to set the ETH fee to any value at any time.
  • The owner of the contract is able to set the implementation address for any token type to any value at any time.
PSIPadTokenModel contract:
  • The deployer of this contract must use this contract to initialize the Base AnySwap token contract address that is used by the Token Deployer contract.
Token contract:
  • The Base Token is an ERC20 token with many customizations; it may have a supply cap, it may be mintable, and it may be burnable, depending on the user's preference.
  • The Base Token implements the EIP-1363 standard in order to support transfer-and-call and approve-and-call functionality.
  • The recipient of the token must be a contract with proper implementations of the onTransferReceived and onApprovalReceived functions.
  • The Base Token also implements the EIP-2612 standard in order to support permits which allows for approvals to be made via signatures.
  • The owner of the contract is able to withdraw any ERC20 or any ETH that is stored in the contract.
TokenAnyswap contract:
  • Anyone can add cross-chain functionalities to a Base Token by initializing the AnySwap Token contract.
  • The AnySwap Token implements the EIP-2612 standard in order to support permits which allows for approvals to be made via signatures.
  • On initialization, the underlying asset address is specified as well as the vault address.
  • Anyone can deposit the underlying asset token into the contract at any time, and will receive an equivalent amount of shares in return.
  • Once deposited, the user can use the "Swapout" function to submit a swap request in order to initiate the process of moving an amount of the underlying asset token from one chain to another.
  • Any address with Minter privileges is able to use the "Swapin" function to complete a swap request to move the amount to the receiving chain; the user is minted an equivalent amount of shares on the desired chain.
  • Cross-chain swaps involve some off-chain logic run by the team. Please note we have not reviewed the off-chain logic related to the bridge.
  • The user can withdraw the deposited underlying asset tokens at any time, and an equivalent amount of shares will be burned from the user.
  • The owner or Vault address is able to change the Vault address to any address at any time; there may be a delay period before the changes are applied.
  • The owner or the Vault address is able to grant or revoke Minter privileges from any address at any time; there may be a delay period before the changes are applied.
  • The Vault address, or any other address with Minter privileges, is able to mint any amount of shares to any address at any time.
  • The Vault address is able to withdraw on behalf of any user at any time; the withdrawn funds are sent to the appropriate user.

Audit Findings Summary:
  • No security issues from outside attackers were identified.
  • Ensure trust in the team as they have notable control in the ecosystem.
  • Users must trust the team as they will operate off-chain logic to power the bridge used for cross-chain transfers.
  • Date: October 3rd, 2021.

External Threat Results

Vulnerability CategoryNotesResult
Arbitrary Storage WriteN/APASS
Arbitrary JumpN/APASS
Delegate Call to Untrusted ContractN/APASS
Dependence on Predictable VariablesN/APASS
Deprecated OpcodesN/APASS
Ether ThiefN/APASS
ExceptionsN/APASS
External CallsN/APASS
Integer Over/UnderflowN/APASS
Multiple SendsN/APASS
SuicideN/APASS
State Change External CallsN/APASS
Unchecked RetvalN/APASS
User Supplied AssertionN/APASS
Critical Solidity CompilerN/APASS
Overall Contract Safety PASS

PSIPadCampaignFactory Contract

Smart Contract Graph

Contract Inheritance


 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public
 
 +  Initializable 

 +  ContextUpgradeable (Initializable)
    - [Int] __Context_init #
       - modifiers: initializer
    - [Int] __Context_init_unchained #
       - modifiers: initializer
    - [Int] _msgSender
    - [Int] _msgData

 +  OwnableUpgradeable (Initializable, ContextUpgradeable)
    - [Int] __Ownable_init #
       - modifiers: initializer
    - [Int] __Ownable_init_unchained #
       - modifiers: initializer
    - [Pub] owner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Prv] _setOwner #

 + [Lib] SafeMathUpgradeable 
    - [Int] tryAdd
    - [Int] trySub
    - [Int] tryMul
    - [Int] tryDiv
    - [Int] tryMod
    - [Int] add
    - [Int] sub
    - [Int] mul
    - [Int] div
    - [Int] mod
    - [Int] sub
    - [Int] div
    - [Int] mod

 + [Lib] AddressUpgradeable 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Prv] _verifyCallResult

 + [Lib] ClonesUpgradeable 
    - [Int] clone #
    - [Int] cloneDeterministic #
    - [Int] predictDeterministicAddress
    - [Int] predictDeterministicAddress

 + [Int] IERC20Upgradeable 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 + [Lib] SafeERC20Upgradeable 
    - [Int] safeTransfer #
    - [Int] safeTransferFrom #
    - [Int] safeApprove #
    - [Int] safeIncreaseAllowance #
    - [Int] safeDecreaseAllowance #
    - [Prv] _callOptionalReturn #

 + [Int] IPSIPadCampaign 
    - [Ext] psipad_factory
    - [Ext] factory_address
    - [Ext] router_address
    - [Ext] stable_coin_fee
    - [Ext] campaignTokens
    - [Ext] feeTokens
    - [Ext] lp_address
    - [Ext] unlock_date
    - [Ext] finalized
    - [Ext] locked
    - [Ext] doRefund
    - [Ext] token
    - [Ext] softCap
    - [Ext] hardCap
    - [Ext] start_date
    - [Ext] end_date
    - [Ext] rate
    - [Ext] min_allowed
    - [Ext] max_allowed
    - [Ext] pool_rate
    - [Ext] lock_duration
    - [Ext] liquidity_rate
    - [Ext] collected
    - [Ext] buyTokens ($)
    - [Ext] lock #
    - [Ext] setLPAddress #
    - [Ext] unlock #
    - [Ext] withdrawTokens #
    - [Ext] withdrawFunds #
    - [Ext] isLive
    - [Ext] failed
    - [Ext] calculateAmount
    - [Ext] getRemaining
    - [Ext] getGivenAmount

 + [Int] IPSIPadCampaignFactory 
    - [Ext] default_factory
    - [Ext] default_router
    - [Ext] fee_aggregator
    - [Ext] stable_coin
    - [Ext] stable_coin_fee
    - [Ext] token_fee
    - [Ext] cloneAddress
    - [Ext] setDefaultFactory #
    - [Ext] setDefaultRouter #
    - [Ext] setFeeAggregator #
    - [Ext] setStableCoin #
    - [Ext] setStableCoinFee #
    - [Ext] setTokenFee #
    - [Ext] setCloneAddress #
    - [Ext] getUserCampaigns
    - [Ext] createCampaign #
    - [Ext] createCampaignWithOwner #
    - [Ext] tokensNeeded
    - [Ext] lock #
    - [Ext] unlock #

 + [Int] IFeeAggregator 
    - [Ext] addFeeToken #
    - [Ext] addTokenFee #

 + [Int] IERC20Upgradeable 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 + [Int] IERC20MetadataUpgradeable (IERC20Upgradeable)
    - [Ext] name
    - [Ext] symbol
    - [Ext] decimals

 + [Int] IBEP20 (IERC20MetadataUpgradeable)
    - [Ext] getOwner

 + [Int] IWETH 
    - [Ext] balanceOf
    - [Ext] deposit ($)
    - [Ext] transfer #
    - [Ext] withdraw #

 + [Int] IPSIPadFactory 
    - [Ext] getPair

 + [Int] IPSIPadRouter 
    - [Ext] addLiquidityETH ($)

 +  PSIPadCampaign (IPSIPadCampaign, Initializable, OwnableUpgradeable)
    - [Pub]  #
    - [Ext] initialize #
       - modifiers: initializer
    - [Ext] buyTokens ($)
    - [Ext] lock #
       - modifiers: onlyPSIPadFactory
    - [Int] calculateFees
    - [Int] transferFees #
    - [Int] addLiquidity #
    - [Ext] setLPAddress #
       - modifiers: onlyOwner
    - [Ext] unlock #
       - modifiers: onlyPSIPadFactory
    - [Ext] withdrawTokens #
    - [Ext] withdrawFunds #
    - [Pub] isLive
    - [Pub] failed
    - [Pub] calculateAmount
    - [Pub] getRemaining
    - [Pub] getGivenAmount

 +  PSIPadCampaignFactory (IPSIPadCampaignFactory, Initializable, OwnableUpgradeable)
    - [Ext] initialize #
       - modifiers: initializer
    - [Ext] setDefaultFactory #
       - modifiers: onlyOwner
    - [Ext] setDefaultRouter #
       - modifiers: onlyOwner
    - [Ext] setFeeAggregator #
       - modifiers: onlyOwner
    - [Ext] setStableCoin #
       - modifiers: onlyOwner
    - [Ext] setStableCoinFee #
       - modifiers: onlyOwner
    - [Ext] setTokenFee #
       - modifiers: onlyOwner
    - [Ext] setCloneAddress #
       - modifiers: onlyOwner
    - [Ext] getUserCampaigns
    - [Ext] createCampaign #
    - [Pub] createCampaignWithOwner #
    - [Int] transferToCampaign #
    - [Pub] tokensNeeded
    - [Int] calculateTokens
    - [Ext] lock #
       - modifiers: isOwner
    - [Ext] unlock #
       - modifiers: isOwner

PSIPadTokenDeployer Contract

Smart Contract Graph

Contract Inheritance


 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public
 
 +  Initializable 

 +  ContextUpgradeable (Initializable)
    - [Int] __Context_init #
       - modifiers: initializer
    - [Int] __Context_init_unchained #
       - modifiers: initializer
    - [Int] _msgSender
    - [Int] _msgData

 +  OwnableUpgradeable (Initializable, ContextUpgradeable)
    - [Int] __Ownable_init #
       - modifiers: initializer
    - [Int] __Ownable_init_unchained #
       - modifiers: initializer
    - [Pub] owner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Prv] _setOwner #

 + [Lib] ClonesUpgradeable 
    - [Int] clone #
    - [Int] cloneDeterministic #
    - [Int] predictDeterministicAddress
    - [Int] predictDeterministicAddress

 + [Int] IERC20Upgradeable 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 + [Lib] AddressUpgradeable 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Prv] _verifyCallResult

 + [Lib] SafeERC20Upgradeable 
    - [Int] safeTransfer #
    - [Int] safeTransferFrom #
    - [Int] safeApprove #
    - [Int] safeIncreaseAllowance #
    - [Int] safeDecreaseAllowance #
    - [Prv] _callOptionalReturn #

 + [Int] IPSIPadCampaign 
    - [Ext] psipad_factory
    - [Ext] factory_address
    - [Ext] router_address
    - [Ext] stable_coin_fee
    - [Ext] campaignTokens
    - [Ext] feeTokens
    - [Ext] lp_address
    - [Ext] unlock_date
    - [Ext] finalized
    - [Ext] locked
    - [Ext] doRefund
    - [Ext] token
    - [Ext] softCap
    - [Ext] hardCap
    - [Ext] start_date
    - [Ext] end_date
    - [Ext] rate
    - [Ext] min_allowed
    - [Ext] max_allowed
    - [Ext] pool_rate
    - [Ext] lock_duration
    - [Ext] liquidity_rate
    - [Ext] collected
    - [Ext] buyTokens ($)
    - [Ext] lock #
    - [Ext] setLPAddress #
    - [Ext] unlock #
    - [Ext] withdrawTokens #
    - [Ext] withdrawFunds #
    - [Ext] isLive
    - [Ext] failed
    - [Ext] calculateAmount
    - [Ext] getRemaining
    - [Ext] getGivenAmount

 + [Int] IPSIPadTokenDeployer 
    - [Ext] fee_aggregator
    - [Ext] stable_coin
    - [Ext] stable_coin_fee
    - [Ext] tokenTypes
    - [Ext] tokens
    - [Ext] getUserTokens
    - [Ext] setFeeAggregator #
    - [Ext] setStableCoin #
    - [Ext] setStableCoinFee #
    - [Ext] setTokenType #
    - [Ext] createToken ($)

 + [Int] IFeeAggregator 
    - [Ext] addFeeToken #
    - [Ext] addTokenFee #

 + [Int] IWETH 
    - [Ext] balanceOf
    - [Ext] deposit ($)
    - [Ext] transfer #
    - [Ext] withdraw #

 + [Int] IERC20Upgradeable 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 + [Int] IERC20MetadataUpgradeable (IERC20Upgradeable)
    - [Ext] name
    - [Ext] symbol
    - [Ext] decimals

 + [Int] IBEP20 (IERC20MetadataUpgradeable)
    - [Ext] getOwner

 + [Int] IToken (IBEP20)
    - [Ext] initialize #

 + [Int] ITokenAnySwap (IBEP20)
    - [Ext] initialize #

 +  PSIPadTokenDeployer (IPSIPadTokenDeployer, Initializable, OwnableUpgradeable)
    - [Ext] initialize #
       - modifiers: initializer
    - [Ext] getUserTokens
    - [Ext] setFeeAggregator #
       - modifiers: onlyOwner
    - [Ext] setStableCoin #
       - modifiers: onlyOwner
    - [Ext] setStableCoinFee #
       - modifiers: onlyOwner
    - [Ext] setTokenType #
       - modifiers: onlyOwner
    - [Ext] createToken ($)
    - [Int] transferFees #
    - [Int] _createToken #

PSIPadTokenLockFactory Contract

Smart Contract Graph

Contract Inheritance


 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public
 
 +  Initializable 

 +  ContextUpgradeable (Initializable)
    - [Int] __Context_init #
       - modifiers: initializer
    - [Int] __Context_init_unchained #
       - modifiers: initializer
    - [Int] _msgSender
    - [Int] _msgData

 +  OwnableUpgradeable (Initializable, ContextUpgradeable)
    - [Int] __Ownable_init #
       - modifiers: initializer
    - [Int] __Ownable_init_unchained #
       - modifiers: initializer
    - [Pub] owner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Prv] _setOwner #

 + [Lib] SafeMath 
    - [Int] tryAdd
    - [Int] trySub
    - [Int] tryMul
    - [Int] tryDiv
    - [Int] tryMod
    - [Int] add
    - [Int] sub
    - [Int] mul
    - [Int] div
    - [Int] mod
    - [Int] sub
    - [Int] div
    - [Int] mod

 + [Int] IERC20 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 + [Lib] AddressUpgradeable 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Prv] _verifyCallResult

 + [Int] IERC20Upgradeable 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 + [Lib] SafeERC20Upgradeable 
    - [Int] safeTransfer #
    - [Int] safeTransferFrom #
    - [Int] safeApprove #
    - [Int] safeIncreaseAllowance #
    - [Int] safeDecreaseAllowance #
    - [Prv] _callOptionalReturn #

 + [Int] IPSIPadTokenLockFactory 
    - [Ext] fee_aggregator
    - [Ext] stable_coin
    - [Ext] stable_coin_fee
    - [Ext] setFeeAggregator #
    - [Ext] setStableCoin #
    - [Ext] setStableCoinFee #
    - [Ext] getUserLocks
    - [Ext] lock ($)
    - [Ext] changeOwner #
    - [Ext] unlock #
    - [Ext] unlockAvailable #
    - [Ext] amountToUnlock
    - [Ext] unlockedAmount

 + [Int] IFeeAggregator 
    - [Ext] addFeeToken #
    - [Ext] addTokenFee #

 + [Int] IWETH 
    - [Ext] balanceOf
    - [Ext] deposit ($)
    - [Ext] transfer #
    - [Ext] withdraw #

 +  PSIPadTokenLockFactory (IPSIPadTokenLockFactory, Initializable, OwnableUpgradeable)
    - [Ext] initialize #
       - modifiers: initializer
    - [Ext] setFeeAggregator #
       - modifiers: onlyOwner
    - [Ext] setStableCoin #
       - modifiers: onlyOwner
    - [Ext] setStableCoinFee #
       - modifiers: onlyOwner
    - [Ext] getUserLocks
    - [Ext] lock ($)
    - [Int] transferFees #
    - [Ext] changeOwner #
       - modifiers: onlyLockOwner
    - [Ext] unlock #
       - modifiers: onlyLockOwner
    - [Ext] unlockAvailable #
       - modifiers: onlyLockOwner
    - [Int] _unlock #
    - [Pub] amountToUnlock
    - [Pub] unlockedAmount

PSIPadTokenModel Contract

Smart Contract Graph

Contract Inheritance


 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public
 
 +  Initializable 

 +  ContextUpgradeable (Initializable)
    - [Int] __Context_init #
       - modifiers: initializer
    - [Int] __Context_init_unchained #
       - modifiers: initializer
    - [Int] _msgSender
    - [Int] _msgData

 + [Int] IERC20Upgradeable 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 + [Int] IERC20MetadataUpgradeable (IERC20Upgradeable)
    - [Ext] name
    - [Ext] symbol
    - [Ext] decimals

 + [Int] IBEP20 (IERC20MetadataUpgradeable)
    - [Ext] getOwner

 +  Initializable 

 +  ContextUpgradeable (Initializable)
    - [Int] __Context_init #
       - modifiers: initializer
    - [Int] __Context_init_unchained #
       - modifiers: initializer
    - [Int] _msgSender
    - [Int] _msgData

 +  OwnableUpgradeable (Initializable, ContextUpgradeable)
    - [Int] __Ownable_init #
       - modifiers: initializer
    - [Int] __Ownable_init_unchained #
       - modifiers: initializer
    - [Pub] owner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Prv] _setOwner #

 +  ERC20Upgradeable (Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable)
    - [Int] __ERC20_init #
       - modifiers: initializer
    - [Int] __ERC20_init_unchained #
       - modifiers: initializer
    - [Pub] name
    - [Pub] symbol
    - [Pub] decimals
    - [Pub] totalSupply
    - [Pub] balanceOf
    - [Pub] transfer #
    - [Pub] allowance
    - [Pub] approve #
    - [Pub] transferFrom #
    - [Pub] increaseAllowance #
    - [Pub] decreaseAllowance #
    - [Int] _transfer #
    - [Int] _mint #
    - [Int] _burn #
    - [Int] _approve #
    - [Int] _beforeTokenTransfer #
    - [Int] _afterTokenTransfer #

 + [Lib] AddressUpgradeable 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Prv] _verifyCallResult

 + [Lib] SafeERC20Upgradeable 
    - [Int] safeTransfer #
    - [Int] safeTransferFrom #
    - [Int] safeApprove #
    - [Int] safeIncreaseAllowance #
    - [Int] safeDecreaseAllowance #
    - [Prv] _callOptionalReturn #

 + [Int] IERC2612 
    - [Ext] DOMAIN_SEPARATOR
    - [Ext] nonces
    - [Ext] permit #
    - [Ext] transferWithPermit #

 +  ERC2612 (Initializable, ERC20Upgradeable, IERC2612)
    - [Int] __ERC2612_init #
       - modifiers: initializer
    - [Pub] version
    - [Ext] permit #
    - [Ext] transferWithPermit #
    - [Int] verifyPermit #
    - [Int] verifyEIP712
    - [Int] verifyPersonalSign
    - [Int] prefixed

 + [Int] IERC677 
    - [Ext] approveAndCall #
    - [Ext] transferAndCall #

 + [Int] ITransferReceiver 
    - [Ext] onTokenTransfer #

 + [Int] IApprovalReceiver 
    - [Ext] onTokenApproval #

 +  ERC677 (ERC20Upgradeable, IERC677)
    - [Ext] approveAndCall #
    - [Ext] transferAndCall #

 + [Int] IAnyswapV4ERC20 (IERC2612, IERC677)
    - [Ext] underlying
    - [Ext] delay
    - [Ext] isMinter
    - [Ext] vault
    - [Ext] pendingMinter
    - [Ext] delayMinter
    - [Ext] pendingVault
    - [Ext] delayVault
    - [Ext] mpc
    - [Ext] changeMPCOwner #
    - [Ext] setVaultOnly #
    - [Ext] initVault #
    - [Ext] setVault #
    - [Ext] applyVault #
    - [Ext] changeVault #
    - [Ext] setMinter #
    - [Ext] applyMinter #
    - [Ext] revokeMinter #
    - [Ext] getAllMinters
    - [Ext] mint #
    - [Ext] burn #
    - [Ext] Swapin #
    - [Ext] Swapout #
    - [Ext] depositWithPermit #
    - [Ext] depositWithTransferPermit #
    - [Ext] deposit #
    - [Ext] deposit #
    - [Ext] deposit #
    - [Ext] depositVault #
    - [Ext] withdraw #
    - [Ext] withdraw #
    - [Ext] withdraw #
    - [Ext] withdrawVault #

 +  AnyswapV4ERC20 (Initializable, IAnyswapV4ERC20, ERC2612, ERC677, OwnableUpgradeable)
    - [Int] __AnyswapV4ERC20_init #
       - modifiers: initializer
    - [Pub] decimals
    - [Pub] mpc
    - [Ext] setVaultOnly #
       - modifiers: onlyOwnerOrVault
    - [Ext] initVault #
       - modifiers: onlyOwnerOrVault
    - [Ext] setMinter #
       - modifiers: onlyOwnerOrVault
    - [Ext] setVault #
       - modifiers: onlyOwnerOrVault
    - [Ext] applyVault #
       - modifiers: onlyOwnerOrVault
    - [Ext] applyMinter #
       - modifiers: onlyOwnerOrVault
    - [Ext] revokeMinter #
       - modifiers: onlyOwnerOrVault
    - [Ext] getAllMinters
    - [Ext] changeVault #
       - modifiers: onlyOwnerOrVault
    - [Pub] changeMPCOwner #
       - modifiers: onlyOwnerOrVault
    - [Ext] mint #
       - modifiers: onlyMinter
    - [Ext] burn #
       - modifiers: onlyMinter
    - [Pub] Swapin #
       - modifiers: onlyMinter
    - [Pub] Swapout #
    - [Ext] depositWithPermit #
    - [Ext] depositWithTransferPermit #
    - [Ext] deposit #
    - [Ext] deposit #
    - [Ext] deposit #
    - [Ext] depositVault #
       - modifiers: onlyVault
    - [Int] _deposit #
    - [Ext] withdraw #
    - [Ext] withdraw #
    - [Ext] withdraw #
    - [Ext] withdrawVault #
       - modifiers: onlyVault
    - [Int] _withdraw #

 +  PSIPadTokenModel (ContextUpgradeable, IBEP20, AnyswapV4ERC20)
    - [Pub]  #
    - [Ext] initialize #
       - modifiers: initializer
    - [Pub] getOwner

Token Contract

Smart Contract Graph

Contract Inheritance


 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public
 
 +  Initializable 

 +  ContextUpgradeable (Initializable)
    - [Int] __Context_init #
       - modifiers: initializer
    - [Int] __Context_init_unchained #
       - modifiers: initializer
    - [Int] _msgSender
    - [Int] _msgData

 +  OwnableUpgradeable (Initializable, ContextUpgradeable)
    - [Int] __Ownable_init #
       - modifiers: initializer
    - [Int] __Ownable_init_unchained #
       - modifiers: initializer
    - [Pub] owner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Prv] _setOwner #

 + [Int] IERC20Upgradeable 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 + [Int] IERC20MetadataUpgradeable (IERC20Upgradeable)
    - [Ext] name
    - [Ext] symbol
    - [Ext] decimals

 +  ERC20Upgradeable (Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable)
    - [Int] __ERC20_init #
       - modifiers: initializer
    - [Int] __ERC20_init_unchained #
       - modifiers: initializer
    - [Pub] name
    - [Pub] symbol
    - [Pub] decimals
    - [Pub] totalSupply
    - [Pub] balanceOf
    - [Pub] transfer #
    - [Pub] allowance
    - [Pub] approve #
    - [Pub] transferFrom #
    - [Pub] increaseAllowance #
    - [Pub] decreaseAllowance #
    - [Int] _transfer #
    - [Int] _mint #
    - [Int] _burn #
    - [Int] _approve #
    - [Int] _beforeTokenTransfer #
    - [Int] _afterTokenTransfer #

 + [Int] IBEP20 (IERC20MetadataUpgradeable)
    - [Ext] getOwner

 + [Lib] AddressUpgradeable 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Prv] _verifyCallResult

 + [Lib] SafeERC20Upgradeable 
    - [Int] safeTransfer #
    - [Int] safeTransferFrom #
    - [Int] safeApprove #
    - [Int] safeIncreaseAllowance #
    - [Int] safeDecreaseAllowance #
    - [Prv] _callOptionalReturn #

 +  ERC20TokenRecover (OwnableUpgradeable)
    - [Pub] recoverERC20 #
       - modifiers: onlyOwner
    - [Pub] recoverETH #
       - modifiers: onlyOwner

 +  ERC20Capped (ERC20Upgradeable)
    - [Int] __ERC20Capped_init_unchained #
       - modifiers: initializer
    - [Int] _mint #

 +  ERC20Burnable (Initializable, ContextUpgradeable, ERC20Upgradeable)
    - [Int] __ERC20Burnable_init_unchained #
       - modifiers: initializer
    - [Pub] burn #
    - [Pub] burnFrom #

 + [Lib] EnumerableSetUpgradeable 
    - [Prv] _add #
    - [Prv] _remove #
    - [Prv] _contains
    - [Prv] _length
    - [Prv] _at
    - [Int] add #
    - [Int] remove #
    - [Int] contains
    - [Int] length
    - [Int] at
    - [Int] add #
    - [Int] remove #
    - [Int] contains
    - [Int] length
    - [Int] at
    - [Int] add #
    - [Int] remove #
    - [Int] contains
    - [Int] length
    - [Int] at

 + [Int] IERC20Mintable (IERC20Upgradeable)
    - [Ext] mintable
    - [Ext] minterDelay
    - [Ext] minterPending
    - [Ext] minters
    - [Ext] addMinter #
    - [Ext] removeMinter #
    - [Ext] applyMinter #
    - [Ext] isMinter
    - [Ext] mint #

 +  ERC20Mintable (Initializable, ContextUpgradeable, OwnableUpgradeable, IERC20Mintable, ERC20Upgradeable)
    - [Int] __ERC20Mintable_init_unchained #
       - modifiers: initializer
    - [Ext] addMinter #
       - modifiers: onlyOwner
    - [Pub] removeMinter #
       - modifiers: onlyOwner
    - [Ext] applyMinter #
       - modifiers: onlyOwner
    - [Pub] isMinter
    - [Int] _addMinter #
    - [Int] _removeMinter #
    - [Ext] minters
    - [Ext] mint #
       - modifiers: isMintable,onlyMinter

 + [Int] IERC165Upgradeable 
    - [Ext] supportsInterface

 +  ERC165Upgradeable (Initializable, IERC165Upgradeable)
    - [Int] __ERC165_init #
       - modifiers: initializer
    - [Int] __ERC165_init_unchained #
       - modifiers: initializer
    - [Pub] supportsInterface

 + [Int] IERC1363 (IERC165Upgradeable, IERC20Upgradeable)
    - [Ext] transferAndCall #
    - [Ext] transferAndCall #
    - [Ext] transferFromAndCall #
    - [Ext] transferFromAndCall #
    - [Ext] approveAndCall #
    - [Ext] approveAndCall #

 + [Int] IERC1363Receiver 
    - [Ext] onTransferReceived #

 + [Int] IERC1363Spender 
    - [Ext] onApprovalReceived #

 +  ERC1363 (IERC1363, ERC165Upgradeable, ERC20Upgradeable)
    - [Pub] supportsInterface
    - [Pub] transferAndCall #
    - [Pub] transferAndCall #
    - [Pub] transferFromAndCall #
    - [Pub] transferFromAndCall #
    - [Pub] approveAndCall #
    - [Pub] approveAndCall #
    - [Int] _checkAndCallTransfer #
    - [Int] _checkAndCallApprove #

 + [Int] IERC2612 (IERC165Upgradeable, IERC20Upgradeable)
    - [Ext] DOMAIN_SEPARATOR
    - [Ext] nonces
    - [Ext] permit #
    - [Ext] transferWithPermit #

 +  ERC2612 (IERC2612, ERC165Upgradeable, ERC20Upgradeable)
    - [Int] __ERC2612_init_unchained #
       - modifiers: initializer
    - [Pub] supportsInterface
    - [Pub] version
    - [Ext] permit #
    - [Ext] transferWithPermit #
    - [Int] verifyPermit #
    - [Int] verifyEIP712
    - [Int] verifyPersonalSign
    - [Int] prefixed

 +  BaseToken (Initializable, ContextUpgradeable, OwnableUpgradeable, IBEP20, ERC20Upgradeable, ERC20TokenRecover, ERC20Capped, ERC20Burnable, ERC20Mintable, ERC1363, ERC2612)
    - [Pub]  #
    - [Pub] __BaseToken_init #
       - modifiers: initializer
    - [Pub] getOwner
    - [Pub] supportsInterface
    - [Int] _mint #

 +  Token (BaseToken)
    - [Pub] initialize #
       - modifiers: initializer

TokenAnySwap Contract

Smart Contract Graph

Contract Inheritance


 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public
 
 +  Initializable 

 +  ContextUpgradeable (Initializable)
    - [Int] __Context_init #
       - modifiers: initializer
    - [Int] __Context_init_unchained #
       - modifiers: initializer
    - [Int] _msgSender
    - [Int] _msgData

 +  OwnableUpgradeable (Initializable, ContextUpgradeable)
    - [Int] __Ownable_init #
       - modifiers: initializer
    - [Int] __Ownable_init_unchained #
       - modifiers: initializer
    - [Pub] owner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Prv] _setOwner #

 + [Int] IERC20Upgradeable 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 + [Int] IERC20MetadataUpgradeable (IERC20Upgradeable)
    - [Ext] name
    - [Ext] symbol
    - [Ext] decimals

 +  ERC20Upgradeable (Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable)
    - [Int] __ERC20_init #
       - modifiers: initializer
    - [Int] __ERC20_init_unchained #
       - modifiers: initializer
    - [Pub] name
    - [Pub] symbol
    - [Pub] decimals
    - [Pub] totalSupply
    - [Pub] balanceOf
    - [Pub] transfer #
    - [Pub] allowance
    - [Pub] approve #
    - [Pub] transferFrom #
    - [Pub] increaseAllowance #
    - [Pub] decreaseAllowance #
    - [Int] _transfer #
    - [Int] _mint #
    - [Int] _burn #
    - [Int] _approve #
    - [Int] _beforeTokenTransfer #
    - [Int] _afterTokenTransfer #

 + [Int] IBEP20 (IERC20MetadataUpgradeable)
    - [Ext] getOwner

 + [Lib] AddressUpgradeable 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Prv] _verifyCallResult

 + [Lib] SafeERC20Upgradeable 
    - [Int] safeTransfer #
    - [Int] safeTransferFrom #
    - [Int] safeApprove #
    - [Int] safeIncreaseAllowance #
    - [Int] safeDecreaseAllowance #
    - [Prv] _callOptionalReturn #

 +  ERC20TokenRecover (OwnableUpgradeable)
    - [Pub] recoverERC20 #
       - modifiers: onlyOwner
    - [Pub] recoverETH #
       - modifiers: onlyOwner

 +  ERC20Capped (ERC20Upgradeable)
    - [Int] __ERC20Capped_init_unchained #
       - modifiers: initializer
    - [Int] _mint #

 +  ERC20Burnable (Initializable, ContextUpgradeable, ERC20Upgradeable)
    - [Int] __ERC20Burnable_init_unchained #
       - modifiers: initializer
    - [Pub] burn #
    - [Pub] burnFrom #

 + [Lib] EnumerableSetUpgradeable 
    - [Prv] _add #
    - [Prv] _remove #
    - [Prv] _contains
    - [Prv] _length
    - [Prv] _at
    - [Int] add #
    - [Int] remove #
    - [Int] contains
    - [Int] length
    - [Int] at
    - [Int] add #
    - [Int] remove #
    - [Int] contains
    - [Int] length
    - [Int] at
    - [Int] add #
    - [Int] remove #
    - [Int] contains
    - [Int] length
    - [Int] at

 + [Int] IERC20Mintable (IERC20Upgradeable)
    - [Ext] mintable
    - [Ext] minterDelay
    - [Ext] minterPending
    - [Ext] minters
    - [Ext] addMinter #
    - [Ext] removeMinter #
    - [Ext] applyMinter #
    - [Ext] isMinter
    - [Ext] mint #

 +  ERC20Mintable (Initializable, ContextUpgradeable, OwnableUpgradeable, IERC20Mintable, ERC20Upgradeable)
    - [Int] __ERC20Mintable_init_unchained #
       - modifiers: initializer
    - [Ext] addMinter #
       - modifiers: onlyOwner
    - [Pub] removeMinter #
       - modifiers: onlyOwner
    - [Ext] applyMinter #
       - modifiers: onlyOwner
    - [Pub] isMinter
    - [Int] _addMinter #
    - [Int] _removeMinter #
    - [Ext] minters
    - [Ext] mint #
       - modifiers: isMintable,onlyMinter

 + [Int] IERC165Upgradeable 
    - [Ext] supportsInterface

 +  ERC165Upgradeable (Initializable, IERC165Upgradeable)
    - [Int] __ERC165_init #
       - modifiers: initializer
    - [Int] __ERC165_init_unchained #
       - modifiers: initializer
    - [Pub] supportsInterface

 + [Int] IERC1363 (IERC165Upgradeable, IERC20Upgradeable)
    - [Ext] transferAndCall #
    - [Ext] transferAndCall #
    - [Ext] transferFromAndCall #
    - [Ext] transferFromAndCall #
    - [Ext] approveAndCall #
    - [Ext] approveAndCall #

 + [Int] IERC1363Receiver 
    - [Ext] onTransferReceived #

 + [Int] IERC1363Spender 
    - [Ext] onApprovalReceived #

 +  ERC1363 (IERC1363, ERC165Upgradeable, ERC20Upgradeable)
    - [Pub] supportsInterface
    - [Pub] transferAndCall #
    - [Pub] transferAndCall #
    - [Pub] transferFromAndCall #
    - [Pub] transferFromAndCall #
    - [Pub] approveAndCall #
    - [Pub] approveAndCall #
    - [Int] _checkAndCallTransfer #
    - [Int] _checkAndCallApprove #

 + [Int] IERC2612 (IERC165Upgradeable, IERC20Upgradeable)
    - [Ext] DOMAIN_SEPARATOR
    - [Ext] nonces
    - [Ext] permit #
    - [Ext] transferWithPermit #

 +  ERC2612 (IERC2612, ERC165Upgradeable, ERC20Upgradeable)
    - [Int] __ERC2612_init_unchained #
       - modifiers: initializer
    - [Pub] supportsInterface
    - [Pub] version
    - [Ext] permit #
    - [Ext] transferWithPermit #
    - [Int] verifyPermit #
    - [Int] verifyEIP712
    - [Int] verifyPersonalSign
    - [Int] prefixed

 +  BaseToken (Initializable, ContextUpgradeable, OwnableUpgradeable, IBEP20, ERC20Upgradeable, ERC20TokenRecover, ERC20Capped, ERC20Burnable, ERC20Mintable, ERC1363, ERC2612)
    - [Pub]  #
    - [Pub] __BaseToken_init #
       - modifiers: initializer
    - [Pub] getOwner
    - [Pub] supportsInterface
    - [Int] _mint #

 + [Int] IAnyswapV4ERC20 (IERC20Upgradeable, IERC20Mintable, IERC2612)
    - [Ext] underlying
    - [Ext] vault
    - [Ext] pendingVault
    - [Ext] delayVault
    - [Ext] mpc
    - [Ext] changeMPCOwner #
    - [Ext] setVaultOnly #
    - [Ext] changeVault #
    - [Ext] revokeVault #
    - [Ext] applyVault #
    - [Ext] burn #
    - [Ext] Swapin #
    - [Ext] Swapout #
    - [Ext] depositWithPermit #
    - [Ext] depositWithTransferPermit #
    - [Ext] deposit #
    - [Ext] deposit #
    - [Ext] deposit #
    - [Ext] depositVault #
    - [Ext] withdraw #
    - [Ext] withdraw #
    - [Ext] withdraw #
    - [Ext] withdrawVault #

 +  AnyswapV4ERC20 (Initializable, ContextUpgradeable, OwnableUpgradeable, IAnyswapV4ERC20, ERC20Upgradeable, ERC20Mintable, ERC2612)
    - [Int] __AnyswapV4ERC20_init #
       - modifiers: initializer
    - [Int] __AnyswapV4ERC20_init_unchained #
       - modifiers: initializer
    - [Pub] decimals
    - [Pub] mpc
    - [Ext] setVaultOnly #
       - modifiers: onlyOwnerOrVault
    - [Pub] changeVault #
       - modifiers: onlyOwnerOrVault
    - [Ext] applyVault #
       - modifiers: onlyOwnerOrVault
    - [Ext] revokeVault #
       - modifiers: onlyOwnerOrVault
    - [Ext] changeMPCOwner #
       - modifiers: onlyOwnerOrVault
    - [Ext] burn #
       - modifiers: onlyMinter
    - [Pub] Swapin #
       - modifiers: onlyMinter
    - [Pub] Swapout #
    - [Ext] depositWithPermit #
    - [Ext] depositWithTransferPermit #
    - [Ext] deposit #
    - [Ext] deposit #
    - [Ext] deposit #
    - [Ext] depositVault #
       - modifiers: onlyVault
    - [Int] _deposit #
    - [Ext] withdraw #
    - [Ext] withdraw #
    - [Ext] withdraw #
    - [Ext] withdrawVault #
       - modifiers: onlyVault
    - [Int] _withdraw #

 +  TokenAnySwap (BaseToken, AnyswapV4ERC20)
    - [Pub] initialize #
       - modifiers: initializer
    - [Int] _mint #