Contract con_enviar_2


Contract Code


  
1 balances = Hash(default_value=0)
2
3 @export
4 def tranferir(amount: int, to: str):
5 assert amount > 0, 'Cannot send negative balances!'
6 sender = ctx.caller
7 assert balances[sender] >= amount, 'Not enough coins to send!'
8 balances[sender] -= amount
9 balances[to] += amount
10

Byte Code

e30000000000000000000000000500000040000000732a000000650064006401640264038d035a016502640183016503650464049c0264056406840483015a05640753002908e900000000da0c636f6e5f656e766961725f32da0862616c616e6365732903da0d64656661756c745f76616c7565da08636f6e7472616374da046e616d652902da06616d6f756e74da02746f630200000000000000030000000400000043000000734e0000007c0064016b047310740064028301820174016a027d0274037c0219007c006b05732a740064038301820174037c02050019007c00380003003c0074037c01050019007c00370003003c006400530029044e72010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573217a194e6f7420656e6f75676820636f696e7320746f2073656e64212904da0e417373657274696f6e4572726f72da03637478da0663616c6c6572da0a5f5f62616c616e636573290372070000007208000000da0673656e646572a900720e000000da00da097472616e666572697204000000730a0000000002100106011401100172100000004e2906da0448617368720c000000da085f5f6578706f7274da03696e74da037374727210000000720e000000720e000000720e000000720f000000da083c6d6f64756c653e0100000073040000000e030601