Handles incoming EOS token transfers to Centralized Exchange deposit account.
- Must be
eosio.token
contract &EOS
symbol (no fake EOS) - Must deposit greater then
1.0000 EOS
(minimum deposit amount) - Must require a memo (can't be blank)
- Create receipt transaction & add entry to table
- Memo must be all numbers (no letters)
- Memo must be 8 digits (or whatever your internal database uses for ID's)
- Allow incoming deposits by verrifying
extended_symbol
(ex: only accepteosio.token
contract &EOS
symbol) - Whitelist accounts (ex:
eosio.ram
&eosio.stake
) to prevent all checks from incoming transfers - Blacklist accounts, prevent deposits from specified accounts
- Allow to clear table row using
id
&trx_id
params
curl --request POST \
--url http://jungle.eosn.io/v1/chain/get_table_rows \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"code":"deposits1111","table":"incoming","scope":"deposits1111","json":true}' | jq .
output
{
"rows": [
{
"id": 0,
"from": "myaccount",
"quantity": "1.0000 EOS",
"memo": "foobar",
"timestamp": "2019-11-14T17:23:45",
"trx_id": "bf50168da5932ba0d6d7233211d946c38cfe98a71e0dfa39e6bcd48296030bb8"
}
],
"more": false,
"next_key": ""
}
import requests
url = "http://jungle.eosn.io/v1/chain/get_table_rows"
payload = "{\"code\":\"deposits1111\",\"table\":\"incoming\",\"scope\":\"deposits1111\"}"
headers = {
'accept': "application/json",
'content-type': "application/json"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
$ ./build.sh
$ cleos set contract <ACCOUNT> ./dist deposit.wasm deposit.abi
$ cleos set account permission <ACCOUNT> active <ACCOUNT> owner --add-code
{uint64_t} id
- deposit id{name} from
- account which sent deposit{asset} quantity
- amount of deposit{string} memo
- memo used{time_point_sec} timestamp
- time of deposit{checksum256} trx_id
- transaction id
{
"id": 1,
"from": "myaccount",
"quantity": "1.0000 EOS",
"memo": "12345",
"timestamp": "2019-11-14T12:00:00",
"trx_id": "<TRANSACTION ID>",
}
Creates a receipt of incoming deposit and stores row in database
- Authority:
get_self()
{name} from
- account which sent deposit{asset} quantity
- amount of deposit{string} memo
- memo used{time_point_sec} timestamp
- time of deposit{checksum256} trx_id
- transaction id