Contract con_fractal_scratch1


Contract Code


  
1 db = Hash(default_value='')
2
3 @export
4 def ping():
5 #ctx.caller is a global variable and is the public key of the person who sent the transaction
6 sender = ctx.caller
7 db[sender] = 'stuff'
8 return 'pong'
9
10 @export
11 def pong(key_name: str, key_value: str):
12 #create a key in your state that contains whatever value was passed
13 db[key_name] = key_value
14 return 'ping'
15

Byte Code

e30000000000000000000000000500000040000000733a000000650064006401640264038d035a0165026401830164046405840083015a036502640183016504650464069c0264076408840483015a0564095300290ada00da14636f6e5f6672616374616c5f7363726174636831da0264622903da0d64656661756c745f76616c7565da08636f6e7472616374da046e616d65630000000000000000010000000300000043000000731200000074006a017d00640174027c003c006402530029034eda057374756666da04706f6e672903da03637478da0663616c6c6572da045f5f64622901da0673656e646572a900720d0000007201000000da0470696e67040000007306000000000206010801720e0000002902da086b65795f6e616d65da096b65795f76616c7565630200000000000000020000000300000043000000730c0000007c0174007c003c006401530029024e720e0000002901720b0000002902720f0000007210000000720d000000720d000000720100000072080000000b00000073040000000002080172080000004e2906da0448617368720b000000da085f5f6578706f7274720e000000da037374727208000000720d000000720d000000720d0000007201000000da083c6d6f64756c653e0100000073060000000e0310070601