Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions OEP4Sample/OEP4Sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ def decimals():
"""
:return: the decimals of the token
"""
return DECIMALS
return DECIMALS + 0


def totalSupply():
"""
:return: the total supply of the token
"""
return Get(ctx, SUPPLY_KEY)
return Get(ctx, SUPPLY_KEY) + 0


def balanceOf(account):
Expand All @@ -137,7 +137,7 @@ def balanceOf(account):
"""
if len(account) != 20:
raise Exception("address length error")
return Get(ctx,concat(BALANCE_PREFIX,account))
return Get(ctx,concat(BALANCE_PREFIX,account)) + 0


def transfer(from_acct,to_acct,amount):
Expand Down Expand Up @@ -265,4 +265,4 @@ def allowance(owner,spender):
:return: the allowed amount of tokens
"""
key = concat(concat(APPROVE_PREFIX,owner),spender)
return Get(ctx,key)
return Get(ctx,key) + 0
6 changes: 3 additions & 3 deletions OEP4Sample/OEP4Sample_compiler2.0.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def totalSupply():
"""
:return: the total supply of the token
"""
return Get(ctx, SUPPLY_KEY)
return Get(ctx, SUPPLY_KEY) + 0


def balanceOf(account):
Expand All @@ -139,7 +139,7 @@ def balanceOf(account):
"""
if len(account) != 20:
raise Exception("address length error")
return Get(ctx,concat(BALANCE_PREFIX,account))
return Get(ctx,concat(BALANCE_PREFIX,account)) + 0


def transfer(from_acct,to_acct,amount):
Expand Down Expand Up @@ -267,4 +267,4 @@ def allowance(owner,spender):
:return: the allowed amount of tokens
"""
key = concat(concat(APPROVE_PREFIX,owner),spender)
return Get(ctx,key)
return Get(ctx,key) + 0