Contract con_test_oracle


Contract Code

1 current_price = Hash(default_value=0)
2 operator = Variable()
3
4
5 @construct
6 def seed():
7 operator.set("486651536e1b361499742017485c882c18af2e49bdfe1975bc587ac913e3f8f2")
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]

Byte Code

e300000000000000000000000005000000400000007354000000650064006401640264038d035a0165026401640464058d025a036406640784005a046505640183016506650764089c026409640a840483015a086505640183016506640b9c01640c640d840483015a09640e5300290fe900000000da0f636f6e5f746573745f6f7261636c65da0d63757272656e745f70726963652903da0d64656661756c745f76616c7565da08636f6e7472616374da046e616d65da086f70657261746f72290272050000007206000000630000000000000000000000000200000043000000730e00000074006a016401830101006400530029024eda40343836363531353336653162333631343939373432303137343835633838326331386166326534396264666531393735626335383761633931336533663866322902da0a5f5f6f70657261746f72da03736574a900720b000000720b000000da00da045f5f5f5f06000000730400000000010401720d0000002902da066e756d626572da096e65775f707269636563020000000000000002000000030000004300000073320000007c0164016b057310740064028301820174016a0274036a0483006b02732674006403830182017c0174057c003c006400530029044e72010000007a1b43616e6e6f7420736574206e6567617469766520707269636573217a2c596f7520646f206e6f742068617665207065726d697373696f6e20746f20736574207468652070726963652e2906da0e417373657274696f6e4572726f72da03637478da0663616c6c65727209000000da03676574da0f5f5f63757272656e745f70726963652902720e000000720f000000720b000000720b000000720c000000da097365745f70726963650b0000007308000000000210011001060172150000002901720e000000630100000000000000010000000200000043000000730800000074007c001900530029014e290172140000002901720e000000720b000000720b000000720c000000da096765745f7072696365130000007302000000000272160000004e290ada04486173687214000000da085661726961626c657209000000720d000000da085f5f6578706f7274da03696e74da05666c6f617472150000007216000000720b000000720b000000720b000000720c000000da083c6d6f64756c653e01000000730e000000060108010c030805060112070601