Skip to content

Commit 1b94809

Browse files
committed
unstake fix
1 parent eec9505 commit 1b94809

File tree

3 files changed

+114
-110
lines changed

3 files changed

+114
-110
lines changed

scatterfunds/scatterfunds.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,11 @@ class scatterfunds : contract {
155155
}
156156

157157
if( t.to == _self ) {
158-
if (code == N(eosio.token)) buy(t);
159-
else if (code == N("ridlridlcoin")){}
158+
if (code == N(eosio.token)) {
159+
if(t.from != N(eosio.stake)) {
160+
buy(t);
161+
}
162+
}
160163
else eosio_assert(false, "This contract only accepts EOS and RIDL tokens");
161164
}
162165
}

scatterfunds/scatterfunds.wasm

0 Bytes
Binary file not shown.

scatterfunds/scatterfunds.wast

Lines changed: 109 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
(data (i32.const 1440) "updater cannot change primary key when modifying an object\00")
7878
(data (i32.const 1504) "Already Started\00")
7979
(data (i32.const 1520) "Contract sent money to itself?\00")
80-
(data (i32.const 1552) "\"ridlridlcoin\"\00")
80+
(data (i32.const 1552) "eosio.stake\00")
8181
(data (i32.const 1568) "This contract only accepts EOS and RIDL tokens\00")
8282
(data (i32.const 10016) "malloc_from_freed was designed to only be called after _heap was completely allocated\00")
8383
(export "memory" (memory $0))
@@ -848,97 +848,100 @@
848848
(get_local $2)
849849
)
850850
)
851-
(call $_ZN12scatterfunds3buyERKN5eosio8currency8transferE
852-
(get_local $0)
853-
(get_local $1)
851+
(set_local $2
852+
(i64.load
853+
(get_local $1)
854+
)
854855
)
855-
(return)
856-
)
857-
(set_local $6
858-
(i64.const 0)
859-
)
860-
(set_local $5
861-
(i64.const 59)
862-
)
863-
(set_local $4
864-
(i32.const 1552)
865-
)
866-
(set_local $7
867-
(i64.const 0)
868-
)
869-
(loop $label$9
870-
(set_local $8
856+
(set_local $6
871857
(i64.const 0)
872858
)
873-
(block $label$10
874-
(block $label$11
875-
(br_if $label$11
876-
(i64.gt_u
877-
(get_local $6)
878-
(i64.const 13)
879-
)
880-
)
881-
(block $label$12
882-
(block $label$13
883-
(br_if $label$13
884-
(i32.gt_u
885-
(i32.and
886-
(i32.add
887-
(tee_local $3
888-
(i32.load8_s
889-
(get_local $4)
859+
(set_local $5
860+
(i64.const 59)
861+
)
862+
(set_local $4
863+
(i32.const 1552)
864+
)
865+
(set_local $7
866+
(i64.const 0)
867+
)
868+
(loop $label$9
869+
(block $label$10
870+
(block $label$11
871+
(block $label$12
872+
(block $label$13
873+
(block $label$14
874+
(br_if $label$14
875+
(i64.gt_u
876+
(get_local $6)
877+
(i64.const 10)
878+
)
879+
)
880+
(br_if $label$13
881+
(i32.gt_u
882+
(i32.and
883+
(i32.add
884+
(tee_local $3
885+
(i32.load8_s
886+
(get_local $4)
887+
)
888+
)
889+
(i32.const -97)
890890
)
891+
(i32.const 255)
891892
)
892-
(i32.const -97)
893+
(i32.const 25)
893894
)
894-
(i32.const 255)
895895
)
896-
(i32.const 25)
896+
(set_local $3
897+
(i32.add
898+
(get_local $3)
899+
(i32.const 165)
900+
)
901+
)
902+
(br $label$12)
897903
)
898-
)
899-
(set_local $3
900-
(i32.add
901-
(get_local $3)
902-
(i32.const 165)
904+
(set_local $8
905+
(i64.const 0)
903906
)
904-
)
905-
(br $label$12)
906-
)
907-
(set_local $3
908-
(select
909-
(i32.add
910-
(get_local $3)
911-
(i32.const 208)
907+
(br_if $label$11
908+
(i64.eq
909+
(get_local $6)
910+
(i64.const 11)
911+
)
912912
)
913-
(i32.const 0)
914-
(i32.lt_u
915-
(i32.and
916-
(i32.add
917-
(get_local $3)
918-
(i32.const -49)
913+
(br $label$10)
914+
)
915+
(set_local $3
916+
(select
917+
(i32.add
918+
(get_local $3)
919+
(i32.const 208)
920+
)
921+
(i32.const 0)
922+
(i32.lt_u
923+
(i32.and
924+
(i32.add
925+
(get_local $3)
926+
(i32.const -49)
927+
)
928+
(i32.const 255)
919929
)
920-
(i32.const 255)
930+
(i32.const 5)
921931
)
922-
(i32.const 5)
923932
)
924933
)
925934
)
926-
)
927-
(set_local $8
928-
(i64.shr_s
929-
(i64.shl
930-
(i64.extend_u/i32
931-
(get_local $3)
935+
(set_local $8
936+
(i64.shr_s
937+
(i64.shl
938+
(i64.extend_u/i32
939+
(get_local $3)
940+
)
941+
(i64.const 56)
932942
)
933943
(i64.const 56)
934944
)
935-
(i64.const 56)
936-
)
937-
)
938-
(br_if $label$11
939-
(i64.gt_u
940-
(get_local $6)
941-
(i64.const 11)
942945
)
943946
)
944947
(set_local $8
@@ -953,50 +956,48 @@
953956
)
954957
)
955958
)
956-
(br $label$10)
957959
)
958-
(set_local $8
959-
(i64.and
960-
(get_local $8)
961-
(i64.const 15)
960+
(set_local $4
961+
(i32.add
962+
(get_local $4)
963+
(i32.const 1)
962964
)
963965
)
964-
)
965-
(set_local $4
966-
(i32.add
967-
(get_local $4)
968-
(i32.const 1)
969-
)
970-
)
971-
(set_local $6
972-
(i64.add
973-
(get_local $6)
974-
(i64.const 1)
966+
(set_local $5
967+
(i64.add
968+
(get_local $5)
969+
(i64.const -5)
970+
)
975971
)
976-
)
977-
(set_local $7
978-
(i64.or
979-
(get_local $8)
980-
(get_local $7)
972+
(set_local $7
973+
(i64.or
974+
(get_local $8)
975+
(get_local $7)
976+
)
981977
)
982-
)
983-
(br_if $label$9
984-
(i64.ne
985-
(tee_local $5
986-
(i64.add
987-
(get_local $5)
988-
(i64.const -5)
978+
(br_if $label$9
979+
(i64.ne
980+
(tee_local $6
981+
(i64.add
982+
(get_local $6)
983+
(i64.const 1)
984+
)
989985
)
986+
(i64.const 13)
990987
)
991-
(i64.const -6)
992988
)
993989
)
994-
)
995-
(br_if $label$1
996-
(i64.eq
997-
(get_local $7)
998-
(get_local $2)
990+
(br_if $label$1
991+
(i64.eq
992+
(get_local $2)
993+
(get_local $7)
994+
)
999995
)
996+
(call $_ZN12scatterfunds3buyERKN5eosio8currency8transferE
997+
(get_local $0)
998+
(get_local $1)
999+
)
1000+
(return)
10001001
)
10011002
(call $eosio_assert
10021003
(i32.const 0)

0 commit comments

Comments
 (0)