Ask us anything. We're here to help.

Smart Contracts at Zero Hash

Background

  • As of 2021-04-01, Platform Operators can now withdraw ETH to Smart Contract addresses via the Zero Hash API.

How it Works

  • You use the same endpoint to trigger a withdrawal- POST /withdrawals/requests.
  • We've added a new optional field called input_data. This is the ABI encoding of the function and its arguments in RLP format.
    • This field is validated against an allowable list from our wallet provider.
    • The ABI encoded value needs the hex prefix "0x". Example:
      0x97c5ed1e000000000000000000000000056a6f9efcee95f55c7f4ab2037fa3ed3193554000000000000000000000000000000000000000000000000000038d7ea4c68000
  • Here is an example payload:
{

"address":"0x722dd3F80BAC40c951b51BdD28Dd19d435762180",
"participant_code":"188IMJ",
"amount":".002",
"asset":"ETH",
"account_group":"188IMJ",
"client_withdrawal_request_id":"smart_contract_example_withdrawal_1",
"input_data":"0x97c5ed1e000000000000000000000000056a6f9efcee95f55c7f4ab2037fa3ed3193554000000000000000000000000000000000000000000000000000038d7ea4c68000"

}
  • You can retrieve the transaction_id in the GET /withdrawals/requests or GET /withdrawals/requests:id endpoint the same way you would for a non-smart contract transaction.

Here is a helpful tool to generate your ABI encoded value.

API Specs