I want to create a keccak256 for on 4 different arguments that my function will receive:
myFunction((token: TealType.uint64, amount: TealType.uint64, payee: TealType.bytes, salt: TealType.bytes)
- First I want to generate a hash based on this message KECCAK256(BYTES("WithdrawSigned(token,payee,amount,salt)")),
PYTEAL CODE:
withdrawSignedMethod.store(Bytes("WithdrawSigned(token,payee,amount,salt)")),
withdraw_signed_method.store(Keccak256(withdrawSignedMethod.load())),
withdraw_signed_method.load()
is a hash generated from Bytes("WithdrawSigned(token,payee,amount,salt)")
- NOW, I want to create hash from the withdraw_signed_method hash and all other function parameters
PYTEAL CODE:
initialS.store(withdraw_signed_method.load(), token, payee, amount, salt),
signedMessage.store(Keccak256(initialS.load())),
But it doesn’t work and gives this error message:
File "full-bridge.py", line 100, in withdraw_token
initialS.store(withdraw_signed_method.load(), token, payee, amount, salt),
TypeError: store() takes 2 positional arguments but 6 were given
Could you please suggest a way using which I would be able to generate hash for all of my input parameters, I’m stuck on this problem for past 1 week?