Skip to content

Commit

Permalink
fix precision type
Browse files Browse the repository at this point in the history
  • Loading branch information
taokayan committed Sep 4, 2023
1 parent ed620fc commit 736b460
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion antelope_contracts/contracts/erc20/include/erc20/erc20.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class [[eosio::contract]] erc20 : public contract {
eosio::asset ingress_fee;
eosio::asset balance; // <-- total amount in EVM side
eosio::asset fee_balance;
int8_t erc20_precision = 0;
uint8_t erc20_precision = 0;

uint64_t primary_key() const {
return id;
Expand Down
1 change: 0 additions & 1 deletion antelope_contracts/contracts/erc20/src/erc20.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ void erc20::transfer(eosio::name from, eosio::name to, eosio::asset quantity,
eosio::check(itr != index.end() && itr->ingress_fee.symbol == quantity.symbol, "received unregistered token");
eosio::check(quantity.amount > itr->ingress_fee.amount, "deposit amount must be greater than ingress fee");

uint64_t ingress_fee = itr->ingress_fee.amount;
quantity -= itr->ingress_fee;
eosio::check(quantity.amount > 0 && quantity.amount < (1ll<<62)-1, "deposit amount overflow");

Expand Down

0 comments on commit 736b460

Please sign in to comment.