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

Function transferMulti

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

:param args: the parameter is an array, containing element like [from, to, amount] :return: True means success, False or raising exception means failure.

(args)

Source from the content-addressed store, hash-verified

179
180
181def transferMulti(args):
182 """
183 :param args: the parameter is an array, containing element like [from, to, amount]
184 :return: True means success, False or raising exception means failure.
185 """
186 for p in args:
187 if len(p) != 3:
188 # return False is wrong
189 raise Exception("transferMulti params error.")
190 if transfer(p[0], p[1], p[2]) == False:
191 # return False is wrong since the previous transaction will be successful
192 raise Exception("transferMulti failed.")
193 return True
194
195
196def approve(owner,spender,amount):

Callers 1

MainFunction · 0.85

Calls 1

transferFunction · 0.70

Tested by

no test coverage detected