Closed alan890104 closed 9 months ago
Tick Test:
receive(msg: JettonTransferNotification)
function of the Oracle contract, code for returning Jettons to the user was not written.receive(msg: JettonTransferNotification)
, I added a sendBackAmount
variable to record how much money needs to be returned to the user after building alarm successfully. Also, I changed the mode to SendIgnoreErrors
and set the value
to sendBackAmount
in the receive(msg: JettonTransferNotification)
.receive(msg: JettonTransferNotification)
, needBaseAssetAmount = msg.amount.float() / baseAssetPrice;
After calculation, it needs to be multiplied by 10**9
to represent the amount of ton to be transferred (e.g., 10/2.5 = 4, which means 4 tons, therefore 4 should be multiplied by Decimal)requireNotInitialized
to self.watchmaker == newAddress(0, 0)
. This means that if watchmaker.address == 0x00
, it indicates that the alarm has not been initialized yet (originally it was judged by self.oracleAddress == newAddress(0, 0)
).Wind Test:
receive(msg: Reset)
function, I changed the require(self.remainScale > msg.buyNum, "Not enough scale to buy");
to >=
, to allow the Timekeeper to buy all of the remainScale
.receive(msg: JettonTransferNotification)
function, within if(opCode == 1)
, the Reset
message's sender is msg.sender
(timekeeper), not ctx.sender
(oracle jetton wallet).receive(msg: Chime)
function, when deploying a new alarm, a basic value
is required to build the contract. I have currently hardcoded it as 0.05 ton.receive(msg: Chime)
function, after building the alarm, totalAlarms
is not incremented by 1.receive(msg: Reset)
function, baseAssetPrice
is not overwritten with a new value. It should be changed to the new price as perceived by the timekeeper. Currently, it is 0, so the baseAssetPrice
for the new alarm built by the timekeeper is also 0.receive(msg: Chime)
function, in addition to checking if msg.remainScale > 0
, should there also be a check to see if the verification stage has passed? Only if it has passed, the price can be changed.receive(msg: Reset)
, if require(self.remainScale >= msg.buyNum, "Not enough scale to buy")
is not met, the jettons are not returned to the timekeeper.receive(msg: Reset)
:needQuoteAssetAmount
is always zero, so that msg.quoteAssetAmount - needQuoteAssetAmount'
is >= 0 and timekeeper can buy base asset anyway.ctx.value > needBaseAssetAmount
, so that it can't make sure that timekeeper brought enough ton to buy quote asset.receive(msg: Chime)
:
Although the reward mechanism is not implemented, its logic will not effect the basic tests. Tests include but not restricted to the below check lists, feel free to provide more testing idea here:
NOTE:
remaining funds
includes TON and jettonsTick
Tick
message open a quote position for a watchmaker.Tick
payload fromJetton Internal Transfer
Wind
Wind
message takes profit from specifiedAlarm
contract, and open a new position with doubled assetsWind
payload fromJetton Internal Transfer
side
oralarmIndex
is incorrectSlickback
to TimeKeeperRing
Mute
message to corresponding Alarm contract