Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate assets when trying to create SAC instance. #1270

Merged
merged 2 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
{
" 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-",
" 1 call bytes_new_from_slice(52)": "",
" 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:15461, mem:132, objs:-/1@c9af83fb",
" 3 call create_asset_contract(Bytes(obj#1))": "",
" 4 call get_ledger_network_id()": "cpu:76310, mem:288",
" 5 ret get_ledger_network_id -> Ok(Bytes(obj#3))": "cpu:77340, mem:400, objs:-/2@7ab71fef",
" 6 call symbol_new_from_slice(10)": "cpu:93744, mem:4152, store:-/1@112a309f, foot:1@248d0d9a",
" 7 ret symbol_new_from_slice -> Ok(Symbol(obj#5))": "cpu:94752, mem:4242, objs:-/3@8615e8c6",
" 8 call symbol_len(Symbol(obj#5))": "cpu:95192, mem:4306, objs:-/4@ac8fb260",
" 9 ret symbol_len -> Ok(U32(10))": "cpu:95314",
" 10 call symbol_copy_to_slice(Symbol(obj#5), U32(0), 10)": "",
" 11 ret symbol_copy_to_slice -> Ok(())": "cpu:95418",
" 12 push SAC:3a8de7cb:sym#5(Bytes(obj#7))": "cpu:105659, mem:5390, objs:-/5@561d1a14, stk:1@5fdb51de, auth:1@9c77a914/-",
" 13 call symbol_index_in_strs(Symbol(obj#5), 17)": "",
" 14 ret symbol_index_in_strs -> Ok(U32(0))": "cpu:107454",
" 15 call vec_new_from_slice(1)": "",
" 16 ret vec_new_from_slice -> Ok(Vec(obj#11))": "cpu:108417, mem:5478, objs:-/6@eaa1014c",
" 17 call has_contract_data(Vec(obj#11), Instance)": "",
" 18 ret has_contract_data -> Ok(False)": "cpu:108565, stk:1@ae827ad9",
" 19 call get_ledger_network_id()": "cpu:169396, mem:5634",
" 20 ret get_ledger_network_id -> Ok(Bytes(obj#13))": "cpu:170426, mem:5746, objs:-/7@2706db99",
" 21 call vec_new_from_slice(1)": "cpu:181422, mem:7780, objs:-/8@b46dbf3",
" 22 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:182385, mem:7868, objs:-/9@f578f08f",
" 23 call put_contract_data(Vec(obj#17), Address(obj#15), Instance)": "",
" 24 ret put_contract_data -> Ok(Void)": "cpu:183169, mem:7908, store:1@73e12810/1@112a309f, stk:1@55da3170",
" 25 call string_new_from_slice(12)": "",
" 26 ret string_new_from_slice -> Ok(String(obj#19))": "cpu:184132, mem:8000, objs:-/10@9d8d79db",
" 27 call bytes_new_from_slice(32)": "cpu:184178",
" 28 ret bytes_new_from_slice -> Ok(Bytes(obj#21))": "cpu:185147, mem:8112, objs:-/11@7a9d5e3c",
" 29 call bytes_len(Bytes(obj#21))": "",
" 30 ret bytes_len -> Ok(U32(32))": "cpu:185269",
" 31 call vec_new_from_slice(1)": "",
" 32 ret vec_new_from_slice -> Ok(Vec(obj#23))": "cpu:186232, mem:8200, objs:-/12@30f389c4",
" 33 call symbol_new_from_slice(10)": "",
" 34 ret symbol_new_from_slice -> Ok(Symbol(obj#25))": "cpu:187240, mem:8290, objs:-/13@6b274835",
" 35 call map_new_from_slices(2)": "",
" 36 call symbol_new_from_slice(10)": "cpu:187773, mem:8354",
" 37 ret symbol_new_from_slice -> Ok(Symbol(obj#27))": "cpu:188781, mem:8444, objs:-/14@cd03540f",
" 38 call obj_cmp(Symbol(obj#27), Symbol(issuer))": "cpu:188951",
" 39 ret obj_cmp -> Ok(-1)": "cpu:189117",
" 40 ret map_new_from_slices -> Ok(Map(obj#29))": "cpu:189557, mem:8508, objs:-/15@103ee106",
" 41 call vec_new_from_slice(2)": "",
" 42 ret vec_new_from_slice -> Ok(Vec(obj#31))": "cpu:190644, mem:8604, objs:-/16@d8339eca",
" 43 call put_contract_data(Vec(obj#23), Vec(obj#31), Instance)": "",
" 44 call obj_cmp(Vec(obj#17), Vec(obj#23))": "cpu:190859, store:-/1@112a309f, stk:-",
" 45 ret obj_cmp -> Ok(-1)": "cpu:191146",
" 46 call obj_cmp(Vec(obj#17), Vec(obj#23))": "cpu:191727, mem:8668",
" 47 ret obj_cmp -> Ok(-1)": "cpu:192014",
" 48 ret put_contract_data -> Ok(Void)": " store:2@44a84c8a/1@112a309f, stk:1@17419f08",
" 49 call vec_new_from_slice(1)": "",
" 50 ret vec_new_from_slice -> Ok(Vec(obj#33))": "cpu:192977, mem:8756, objs:-/17@f152d388",
" 51 call get_contract_data(Vec(obj#33), Instance)": "",
" 52 call obj_cmp(Vec(obj#23), Vec(obj#33))": "cpu:193089, store:-/1@112a309f, stk:-",
" 53 ret obj_cmp -> Ok(0)": "cpu:193376",
" 54 ret get_contract_data -> Ok(Vec(obj#31))": "cpu:193482, store:2@44a84c8a/1@112a309f, stk:1@17419f08",
" 55 call vec_get(Vec(obj#31), U32(0))": "",
" 56 ret vec_get -> Ok(Symbol(obj#25))": "cpu:193708",
" 57 call symbol_index_in_strs(Symbol(obj#25), 3)": "",
" 58 ret symbol_index_in_strs -> Ok(U32(2))": "cpu:194025",
" 59 call vec_get(Vec(obj#31), U32(1))": "",
" 60 ret vec_get -> Ok(Map(obj#29))": "cpu:194251",
" 61 call map_unpack_to_slice(Map(obj#29), 2)": "",
" 62 ret map_unpack_to_slice -> Ok(Void)": "cpu:194602",
" 63 call bytes_len(Bytes(obj#21))": "",
" 64 ret bytes_len -> Ok(U32(32))": "cpu:194724",
" 65 call string_len(String(obj#19))": "",
" 66 ret string_len -> Ok(U32(12))": "cpu:194846",
" 67 call string_copy_to_slice(String(obj#19), U32(0), 12)": "",
" 68 ret string_copy_to_slice -> Ok(())": "cpu:194950",
" 69 call bytes_copy_to_slice(Bytes(obj#21), U32(0), 32)": "cpu:195404, mem:8933",
" 70 ret bytes_copy_to_slice -> Ok(())": "cpu:195511",
" 71 call string_new_from_slice(69)": "",
" 72 ret string_new_from_slice -> Ok(String(obj#35))": "cpu:196488, mem:9082, objs:-/18@453ace36",
" 73 call map_new_from_slices(3)": "",
" 74 ret map_new_from_slices -> Ok(Map(obj#37))": "cpu:197640, mem:9234, objs:-/19@c4cd6319",
" 75 call put_contract_data(Symbol(METADATA), Map(obj#37), Instance)": "",
" 76 call obj_cmp(Vec(obj#23), Symbol(METADATA))": "cpu:197797, store:-/1@112a309f, stk:-",
" 77 ret obj_cmp -> Ok(1)": "cpu:197919",
" 78 call obj_cmp(Vec(obj#17), Symbol(METADATA))": "",
" 79 ret obj_cmp -> Ok(1)": "cpu:198041",
" 80 call obj_cmp(Symbol(METADATA), Vec(obj#17))": "cpu:198631, mem:9322",
" 81 ret obj_cmp -> Ok(-1)": "cpu:198753",
" 82 call obj_cmp(Vec(obj#17), Vec(obj#23))": "",
" 83 ret obj_cmp -> Ok(-1)": "cpu:199040",
" 84 ret put_contract_data -> Ok(Void)": " store:3@6a6c37f3/1@112a309f, stk:1@bf8d1642",
" 85 pop SAC:3a8de7cb:sym#5 -> Ok(Void)": "cpu:209700, mem:11431, store:3@6a6c37f3/1@6a6fc3f5",
" 86 ret create_asset_contract -> Ok(Address(obj#39))": "cpu:210201, mem:11495, objs:-/20@ff446a46, store:-/1@6a6fc3f5, stk:-, auth:-/-",
" 87 call get_ledger_network_id()": "",
" 88 ret get_ledger_network_id -> Ok(Bytes(obj#41))": "cpu:211231, mem:11607, objs:-/21@da15c087",
" 89 call vec_new()": "cpu:221848, mem:13577",
" 90 ret vec_new -> Ok(Vec(obj#43))": "cpu:222349, mem:13641, objs:-/22@9bd28cb6",
" 91 call call(Address(obj#39), Symbol(symbol), Vec(obj#43))": "",
" 92 push SAC:3a8de7cb:symbol()": "cpu:252199, mem:18281, objs:-/23@f0a900ae, stk:1@e09e31c1, auth:1@335d484a/-",
" 93 call symbol_index_in_strs(Symbol(symbol), 17)": "",
" 94 ret symbol_index_in_strs -> Ok(U32(16))": "cpu:252947",
" 95 call get_contract_data(Symbol(METADATA), Instance)": "",
" 96 call obj_cmp(Symbol(obj#61), Symbol(issuer))": "cpu:263846, mem:19530, objs:-/33@431eb91a, stk:-",
" 97 ret obj_cmp -> Ok(-1)": "cpu:264012",
" 98 call obj_cmp(Symbol(METADATA), Vec(obj#53))": "cpu:264943, mem:19658, objs:-/35@15c61877",
" 99 ret obj_cmp -> Ok(-1)": "cpu:265065",
" 100 call obj_cmp(Vec(obj#53), Vec(obj#57))": "",
" 101 ret obj_cmp -> Ok(-1)": "cpu:265352",
" 102 call obj_cmp(Vec(obj#53), Symbol(METADATA))": "cpu:265403",
" 103 ret obj_cmp -> Ok(1)": "cpu:265525",
" 104 ret get_contract_data -> Ok(Map(obj#51))": "cpu:265631, store:3@d9876781/1@6a6fc3f5, stk:1@353357e4",
" 105 call map_unpack_to_slice(Map(obj#51), 3)": "",
" 106 ret map_unpack_to_slice -> Ok(Void)": "cpu:265971",
" 107 pop SAC:3a8de7cb:symbol -> Ok(String(obj#49))": "",
" 108 ret call -> Ok(String(obj#49))": "cpu:266032, store:-/1@6a6fc3f5, stk:-, auth:-/-",
" 109 call string_len(String(obj#49))": "",
" 110 ret string_len -> Ok(U32(12))": "cpu:266154",
" 111 call string_copy_to_slice(String(obj#49), U32(0), 12)": "",
" 112 ret string_copy_to_slice -> Ok(())": "cpu:266258",
" 113 call vec_new()": "",
" 114 ret vec_new -> Ok(Vec(obj#71))": "cpu:266759, mem:19722, objs:-/36@7fd64fe6",
" 115 call call(Address(obj#39), Symbol(decimals), Vec(obj#71))": "",
" 116 push SAC:3a8de7cb:decimals()": "cpu:296609, mem:24362, objs:-/37@95ae5ecd, stk:1@424a5cf3, auth:1@bc6e6f7c/-",
" 117 call symbol_index_in_strs(Symbol(decimals), 17)": "",
" 118 ret symbol_index_in_strs -> Ok(U32(14))": "cpu:297367",
" 119 pop SAC:3a8de7cb:decimals -> Ok(U32(7))": "",
" 120 ret call -> Ok(U32(7))": " stk:-, auth:-/-",
" 121 call vec_new()": "",
" 122 ret vec_new -> Ok(Vec(obj#75))": "cpu:297868, mem:24426, objs:-/38@74ddc4b2",
" 123 call call(Address(obj#39), Symbol(name), Vec(obj#75))": "",
" 124 push SAC:3a8de7cb:name()": "cpu:327718, mem:29066, objs:-/39@63dc5eb, stk:1@21f4ed4, auth:1@3794dbfb/-",
" 125 call symbol_index_in_strs(Symbol(name), 17)": "",
" 126 ret symbol_index_in_strs -> Ok(U32(15))": "cpu:328466",
" 127 call get_contract_data(Symbol(METADATA), Instance)": "",
" 128 call obj_cmp(Symbol(obj#93), Symbol(issuer))": "cpu:339365, mem:30315, objs:-/49@638b2be9, stk:-",
" 129 ret obj_cmp -> Ok(-1)": "cpu:339531",
" 130 call obj_cmp(Symbol(METADATA), Vec(obj#85))": "cpu:340462, mem:30443, objs:-/51@f594ceea",
" 131 ret obj_cmp -> Ok(-1)": "cpu:340584",
" 132 call obj_cmp(Vec(obj#85), Vec(obj#89))": "",
" 133 ret obj_cmp -> Ok(-1)": "cpu:340871",
" 134 call obj_cmp(Vec(obj#85), Symbol(METADATA))": "cpu:340922",
" 135 ret obj_cmp -> Ok(1)": "cpu:341044",
" 136 ret get_contract_data -> Ok(Map(obj#83))": "cpu:341150, store:3@3ede9abd/1@6a6fc3f5, stk:1@4c046505",
" 137 call map_unpack_to_slice(Map(obj#83), 3)": "",
" 138 ret map_unpack_to_slice -> Ok(Void)": "cpu:341490",
" 139 pop SAC:3a8de7cb:name -> Ok(String(obj#79))": "",
" 140 ret call -> Ok(String(obj#79))": "cpu:341551, store:-/1@6a6fc3f5, stk:-, auth:-/-",
" 141 call string_len(String(obj#79))": "",
" 142 ret string_len -> Ok(U32(69))": "cpu:341673",
" 143 call string_copy_to_slice(String(obj#79), U32(0), 69)": "",
" 144 ret string_copy_to_slice -> Ok(())": "cpu:341784",
" 145 call vec_new_from_slice(1)": "cpu:346498, mem:31308, objs:-/52@79bdd00b, store:-/3@d9f3a949, foot:3@d93be167",
" 146 ret vec_new_from_slice -> Ok(Vec(obj#105))": "cpu:347522, mem:31396, objs:-/53@b2ae955d",
" 147 call call(Address(obj#39), Symbol(balance), Vec(obj#105))": "",
" 148 push SAC:3a8de7cb:balance(Address(obj#103))": "cpu:377448, mem:36188, objs:-/54@5324f8e3, stk:1@3f5d9587, auth:1@cf93c1c5/-",
" 149 call symbol_index_in_strs(Symbol(balance), 17)": "",
" 150 ret symbol_index_in_strs -> Ok(U32(3))": "cpu:378196",
" 151 call extend_current_contract_instance_and_code_ttl(U32(103680), U32(120960))": "",
" 152 call get_ledger_sequence()": "cpu:379337, mem:36324, store:-/-, foot:-",
" 153 ret get_ledger_sequence -> Ok(U32(123))": "",
" 154 ret extend_current_contract_instance_and_code_ttl -> Ok(Void)": "cpu:390190, mem:38318, store:-/3@61d55b43, foot:3@d93be167",
" 155 call vec_new_from_slice(1)": "cpu:390297",
" 156 ret vec_new_from_slice -> Ok(Vec(obj#109))": "cpu:391260, mem:38406, objs:-/55@ec3d961b",
" 157 call get_contract_data(Vec(obj#109), Instance)": "",
" 158 call obj_cmp(Symbol(obj#125), Symbol(issuer))": "cpu:402220, mem:39655, objs:-/65@44ba42a8, stk:-",
" 159 ret obj_cmp -> Ok(-1)": "cpu:402386",
" 160 call obj_cmp(Symbol(METADATA), Vec(obj#117))": "cpu:403317, mem:39783, objs:-/67@1fd84d57",
" 161 ret obj_cmp -> Ok(-1)": "cpu:403439",
" 162 call obj_cmp(Vec(obj#117), Vec(obj#121))": "",
" 163 ret obj_cmp -> Ok(-1)": "cpu:403726",
" 164 call obj_cmp(Vec(obj#117), Vec(obj#109))": "cpu:403777",
" 165 ret obj_cmp -> Ok(-1)": "cpu:404064",
" 166 call obj_cmp(Vec(obj#121), Vec(obj#109))": "",
" 167 ret obj_cmp -> Ok(0)": "cpu:404351",
" 168 ret get_contract_data -> Ok(Vec(obj#133))": "cpu:404457, store:3@3c9378ad/3@61d55b43, stk:1@ea68cf9d",
" 169 call vec_get(Vec(obj#133), U32(0))": "",
" 170 ret vec_get -> Ok(Symbol(obj#123))": "cpu:404683",
" 171 call symbol_index_in_strs(Symbol(obj#123), 3)": "",
" 172 ret symbol_index_in_strs -> Ok(U32(2))": "cpu:405000",
" 173 call vec_get(Vec(obj#133), U32(1))": "",
" 174 ret vec_get -> Ok(Map(obj#131))": "cpu:405226",
" 175 call map_unpack_to_slice(Map(obj#131), 2)": "",
" 176 ret map_unpack_to_slice -> Ok(Void)": "cpu:405577",
" 177 call bytes_len(Bytes(obj#129))": "",
" 178 ret bytes_len -> Ok(U32(32))": "cpu:405699",
" 179 call string_len(String(obj#127))": "cpu:405806",
" 180 ret string_len -> Ok(U32(12))": "cpu:405928",
" 181 call string_copy_to_slice(String(obj#127), U32(0), 12)": "",
" 182 ret string_copy_to_slice -> Ok(())": "cpu:406032",
" 183 pop SAC:3a8de7cb:balance -> Ok(I128(10000000))": "cpu:407024, mem:39919",
" 184 ret call -> Ok(I128(10000000))": " store:-/3@61d55b43, stk:-, auth:-/-",
" 185 end": "cpu:407024, mem:39919, prngs:-/9b4a753, objs:-/67@1fd84d57, vm:-/-, evt:-, store:-/3@61d55b43, foot:3@d93be167, stk:-, auth:-/-"
}
Loading