Skip to content

Commit

Permalink
fix: TMC1-1 Mismatch of Judgement Conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
ipromise2324 committed Apr 30, 2024
1 parent 1c4c6f5 commit dad0704
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contracts/jetton_master_chef.tact
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ contract JettonMasterChef with Deployable, MasterChef {
}

// check if pool exists or exceed the deadline
if(self.pools.get(ctx.sender) == null || now() > self.deadline || now() < self.startTime){
if(self.pools.get(ctx.sender) == null || now() > self.deadline || now() < self.startTime || ctx.value < ton("0.04")){
// Send the jetton back to the sender if pool does not exist
self.sendJetton(ctx.sender, 0, msg.amount, msg.sender, msg.sender, SendRemainingValue);
return;
Expand Down
4 changes: 2 additions & 2 deletions contracts/ton_master_chef.tact
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ contract TonMasterChef with Deployable, MasterChef {
let ctx: Context = context();
// Calculate reward per second in basicSetUp() and also other basic setup
self.basicSetUp(msg.thunderMintWallet, msg.metaData, msg.totalReward, msg.deadline, msg.startTime);
if(self.rewardPerSecond <= 0 || now() > self.deadline) {
if(self.rewardPerSecond <= 0) {
send(SendParameters{
to: self.owner,
value: 0,
Expand All @@ -56,7 +56,7 @@ contract TonMasterChef with Deployable, MasterChef {
let remainTon: Int = ctx.value - MIN_GAS_FEE;
let feeForDevs: Int = msg.totalReward * FEE_PERCENT_FOR_DEV / 1000;
let expectedTon: Int = msg.totalReward + feeForDevs;
if (remainTon < expectedTon) {
if (remainTon < expectedTon || now() > self.deadline) {
send(SendParameters{
to: msg.owner,
value: remainTon,
Expand Down

0 comments on commit dad0704

Please sign in to comment.