Skip to content

Commit

Permalink
bugfix (#23)
Browse files Browse the repository at this point in the history
* bugfix

* add error messages
  • Loading branch information
wc117 authored Aug 25, 2023
1 parent c639544 commit ec0c6cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contracts/Turnstone.vy
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ def _safe_transfer_from(_token: address, _from: address, _to: address, _value: u
def send_token_to_paloma(token: address, receiver: String[64], amount: uint256):
_balance: uint256 = ERC20(token).balanceOf(self)
self._safe_transfer_from(token, msg.sender, self, amount)
_balance -= ERC20(token).balanceOf(self)
assert _balance > 0
_balance = ERC20(token).balanceOf(self) - _balance
assert _balance > 0, "Zero Transfer"
log SendToPalomaEvent(token, msg.sender, receiver, amount)

@internal
Expand All @@ -208,7 +208,7 @@ def submit_batch(consensus: Consensus, token: address, args: TokenSendArgs, mess
assert block.timestamp <= deadline, "Timeout"
assert not self.message_id_used[message_id], "Used Message_ID"
length: uint256 = len(args.receiver)
assert length == len(args.amount)
assert length == len(args.amount), "Unmatched Params"
self.message_id_used[message_id] = True
# check if the supplied current validator set matches the saved checkpoint
assert self.last_checkpoint == self.make_checkpoint(consensus.valset), "Incorrect Checkpoint"
Expand Down

0 comments on commit ec0c6cc

Please sign in to comment.