Welcome to the Harpie docs!
  • About
    • Whitepaper
    • What attacks can Harpie prevent?
  • Tech & Security
    • Harpie's Anti-Theft Tech
    • About the Transaction Firewall
    • About the Harpie Vault
    • Security
    • Contracts
      • Deployments
      • Transferer
      • Noncustodial Vault
      • Audit
    • Disclosures & Risks
  • Help
    • Getting Started
      • Get Protected
        • Protecting a token or NFT
        • Setting a withdrawal address
    • My NFTs are stuck in the Harpie Vault, how do I recover them?
    • My Vault is saying I only have 1 NFT recovered, but there should be more
    • FAQ
      • Is Harpie audited?
      • What is Harpie?
      • What is a Trusted Network?
      • What happens when I "Protect" something?
      • What is a Withdrawal Address?
  • Harpie For Enterprise
    • Harpie For Enterprise
      • Background Check API
      • Methods
        • Validate Address
        • Validate Transaction
        • Get Contract Name
Powered by GitBook
On this page
  • Roles
  • Transfer Functions
  • Permission Functions
  1. Tech & Security
  2. Contracts

Transferer

The Transferer contract has the ability to move your tokens to our noncustodial Vault. It cannot transfer your tokens anywhere else.

Below is a function-by-function explanation of the code.

Roles

address immutable private vaultAddress; // set during construction
address immutable private transferEOASetter; // set during construction
mapping(address => bool) private _transferEOAs;

There are three roles (one dynamic, two immutable and set during construction) in this contract:

  • vaultAddress is the address of the associated Noncustodial Vault

  • transferEOAs are addresses that can call our Transfer Functions. These addresses are controlled by our automated detection algorithm

  • transferEOASetter is an address owned by Harpie that can set _transferEOAs

Transfer Functions

function transferERC721(
    address _ownerAddress, 
    address _erc721Address, 
    uint256 _erc721Id, 
    uint128 _fee
) public returns (bool)

function transferERC20(
    address _ownerAddress, 
    address _erc20Address, 
    uint128 _fee
) public returns (bool)

function batchTransferERC721(ERC721Details[] memory _details) public returns (bool)

function batchTransferERC20(ERC20Details[] memory _details) public returns (bool)

These functions transfer user assets into the Vault when we detect a malicious transaction. They're hardcoded to transfer tokens to the vaultAddress role, and cannot submit user tokens anywhere else. They are only callable by the transferEOA role.

  • The transfer functions transfer a single user's assets (ERC20/ERC721) to the Vault.

  • The batchTransfer functions are able to transfer multiple users' assets. We use these in case of large-scale attacks.

Permission Functions

function addTransferEOA(address _newTransferEOA) public

function removeTransferEOA(address _eoaToBeRemoved) public

function removeAbilityToSetNewTransferEOAs() public

These functions are only callable by the role transferEOASetter.

  • addTransferEEOA and removeTransferEOA add and remove transferEOAs, the wallets that are able to call the Transfer Functions

  • removeAbilityToSetNewTransferEOAs is a permanent operation that prevents the addition of any new transferEOAs. After calling this flag, Harpie is no longer able to add new wallets to the transferEOA role, but will still able to remove them.

PreviousDeploymentsNextNoncustodial Vault

Last updated 1 year ago