Contract con_rubix_test_dec_oracle


Contract Code

1 current_price = Hash(default_value=0)
2 operator = Variable()
3
4
5 @construct
6 def seed():
7 operator.set(ctx.caller)
8
9
10 @export
11 def set_price(number: int, new_price: float):
12 assert new_price >= 0, 'Cannot set negative prices!'
13 assert ctx.caller == operator.get(), 'You do not have permission to set the price.'
14
15 current_price[number] = new_price
16
17
18 @export
19 def get_price(number: int):
20 return current_price[number]
21

Byte Code

e300000000000000000000000005000000400000007354000000650064006401640264038d035a0165026401640464058d025a036406640784005a046505640183016506650764089c026409640a840483015a086505640183016506640b9c01640c640d840483015a09640e5300290fe900000000da19636f6e5f72756269785f746573745f6465635f6f7261636c65da0d63757272656e745f70726963652903da0d64656661756c745f76616c7565da08636f6e7472616374da046e616d65da086f70657261746f72290272050000007206000000630000000000000000000000000200000043000000731000000074006a0174026a03830101006400530029014e2904da0a5f5f6f70657261746f72da03736574da03637478da0663616c6c6572a900720c000000720c000000da00da045f5f5f5f0600000073020000000001720e0000002902da066e756d626572da096e65775f707269636563020000000000000002000000030000004300000073320000007c0164016b057310740064028301820174016a0274036a0483006b02732674006403830182017c0174057c003c006400530029044e72010000007a1b43616e6e6f7420736574206e6567617469766520707269636573217a2c596f7520646f206e6f742068617665207065726d697373696f6e20746f20736574207468652070726963652e2906da0e417373657274696f6e4572726f72720a000000720b0000007208000000da03676574da0f5f5f63757272656e745f70726963652902720f0000007210000000720c000000720c000000720d000000da097365745f70726963650a0000007308000000000210011001060172140000002901720f000000630100000000000000010000000200000043000000730800000074007c001900530029014e290172130000002901720f000000720c000000720c000000720d000000da096765745f7072696365120000007302000000000272150000004e290ada04486173687213000000da085661726961626c657208000000720e000000da085f5f6578706f7274da03696e74da05666c6f617472140000007215000000720c000000720c000000720c000000720d000000da083c6d6f64756c653e01000000730e00000004010a010c030804060112070601