Zilliqa / zq2

Zilliqa 2.0 code base
Apache License 2.0
9 stars 0 forks source link

Support different ways of funding a user/contract by calling a transition #1427

Closed saeed-zil closed 1 month ago

saeed-zil commented 1 month ago

These should be supported:

transition fundUserWithTag( user : ByStr20, amount : Uint128)
  msg = { _tag : "AddFunds"; _recipient : user ; _amount : amount };
  no_msg = Nil {Message};
  msgs = Cons {Message} msg no_msg;
  send msgs
end

transition fundUser (user : ByStr20, amount : Uint128)
  msg = { _tag : "" ; _recipient : user ; _amount : amount };
  no_msg = Nil {Message};
  msgs = Cons {Message} msg no_msg;
  send msgs
end

transition fundContract (contract_address : ByStr20, amount : Uint128)
  msg = { _tag : "acceptZil" ; _recipient : contract_address ; _amount : amount };
  no_msg = Nil {Message};
  msgs = Cons {Message} msg no_msg;
  send msgs
end
saeed-zil commented 1 month ago

Tests are enabled in #1423