MCPcopy Create free account
hub / github.com/DNAProject/DNA / Main

Function Main

wasmtest/contracts-cplus/test_oep4.py:28–84  ·  view source on GitHub ↗

:param operation: :param args: :return:

(operation, args)

Source from the content-addressed store, hash-verified

26
27
28def Main(operation, args):
29 """
30 :param operation:
31 :param args:
32 :return:
33 """
34 # 'init' has to be invokded first after deploying the contract to store the necessary and important info in the blockchain
35 if operation == 'init':
36 return init()
37 if operation == 'name':
38 return name()
39 if operation == 'symbol':
40 return symbol()
41 if operation == 'decimals':
42 return decimals()
43 if operation == 'totalSupply':
44 return totalSupply()
45 if operation == 'balanceOf':
46 if len(args) != 1:
47 return False
48 acct = args[0]
49 return balanceOf(acct)
50 if operation == 'transfer':
51 if len(args) != 3:
52 return False
53 else:
54 from_acct = args[0]
55 to_acct = args[1]
56 amount = args[2]
57 return transfer(from_acct,to_acct,amount)
58 if operation == 'transferMulti':
59 return transferMulti(args)
60 if operation == 'transferFrom':
61 if len(args) != 4:
62 return False
63 spender = args[0]
64 from_acct = args[1]
65 to_acct = args[2]
66 amount = args[3]
67 return transferFrom(spender,from_acct,to_acct,amount)
68 if operation == 'approve':
69 if len(args) != 3:
70 return False
71 owner = args[0]
72 spender = args[1]
73 amount = args[2]
74 return approve(owner,spender,amount)
75 if operation == 'allowance':
76 if len(args) != 2:
77 return False
78 owner = args[0]
79 spender = args[1]
80 return allowance(owner,spender)
81 if operation == 'testcase':
82 return testcase()
83
84 return False
85

Callers

nothing calls this directly

Calls 12

nameFunction · 0.85
symbolFunction · 0.85
decimalsFunction · 0.85
totalSupplyFunction · 0.85
balanceOfFunction · 0.85
transferMultiFunction · 0.85
allowanceFunction · 0.85
initFunction · 0.70
transferFunction · 0.70
transferFromFunction · 0.70
approveFunction · 0.70
testcaseFunction · 0.70

Tested by

no test coverage detected