From 659730941488f3045cd55617a3281c386bff8419 Mon Sep 17 00:00:00 2001 From: lucas7788 Date: Fri, 11 Sep 2020 10:21:54 +0800 Subject: [PATCH 1/2] add type transfer --- OEP4Sample/OEP4Sample.py | 6 +++--- OEP4Sample/OEP4Sample_compiler2.0.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/OEP4Sample/OEP4Sample.py b/OEP4Sample/OEP4Sample.py index 2023603..7628015 100644 --- a/OEP4Sample/OEP4Sample.py +++ b/OEP4Sample/OEP4Sample.py @@ -127,7 +127,7 @@ def totalSupply(): """ :return: the total supply of the token """ - return Get(ctx, SUPPLY_KEY) + return Get(ctx, SUPPLY_KEY) + 0 def balanceOf(account): @@ -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): @@ -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) \ No newline at end of file + return Get(ctx,key) + 0 \ No newline at end of file diff --git a/OEP4Sample/OEP4Sample_compiler2.0.py b/OEP4Sample/OEP4Sample_compiler2.0.py index 7d559f1..27bfd04 100644 --- a/OEP4Sample/OEP4Sample_compiler2.0.py +++ b/OEP4Sample/OEP4Sample_compiler2.0.py @@ -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): @@ -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): @@ -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) \ No newline at end of file + return Get(ctx,key) + 0 \ No newline at end of file From 23149a673241af200771666704366f906c25e507 Mon Sep 17 00:00:00 2001 From: lucas Date: Tue, 19 Jan 2021 17:02:53 +0800 Subject: [PATCH 2/2] Update OEP4Sample.py --- OEP4Sample/OEP4Sample.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OEP4Sample/OEP4Sample.py b/OEP4Sample/OEP4Sample.py index 7628015..068b374 100644 --- a/OEP4Sample/OEP4Sample.py +++ b/OEP4Sample/OEP4Sample.py @@ -120,7 +120,7 @@ def decimals(): """ :return: the decimals of the token """ - return DECIMALS + return DECIMALS + 0 def totalSupply(): @@ -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) + 0 \ No newline at end of file + return Get(ctx,key) + 0