Skip to content
Open
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
23 changes: 22 additions & 1 deletion generated_contracts/bridge_reward/bridge_reward.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions listener/ronin.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,19 @@ func (l *RoninListener) ExternalCallFailedCallback(fromChainId *big.Int, tx brid
}

// We only process ExternalCallFailed event with to = bridge reward and
// msgSig = IBridgeReward.execSyncReward.selector or
// msgSig = IBridgeReward.execSyncReward.selector
// execSyncReward(address[],uint256[],uint256,uint256,uint256)
var execSyncRewardSelector = [4]byte(common.Hex2Bytes("6bcb6fd6"))
var (
// execSyncReward(address[],uint256[],uint256,uint256,uint256)
execSyncRewardSelector = [4]byte(common.Hex2Bytes("6bcb6fd6"))

// execSyncRewardAuto(uint256)
execSyncRewardAutoSelector = [4]byte(common.Hex2Bytes("b77f2a40"))
)
if failedEvent.To != common.HexToAddress(l.config.Contracts[task.BRIDGE_REWARD_CONTRACT]) {
return nil
}
if failedEvent.MsgSig != execSyncRewardSelector {
if failedEvent.MsgSig != execSyncRewardSelector && failedEvent.MsgSig != execSyncRewardAutoSelector {
return nil
}

Expand Down
9 changes: 7 additions & 2 deletions task/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,13 @@ func (r *task) syncReward(task *models.Task) (doneTasks, processingTasks, failed
return bridgeRewardContract.SyncRewardManual(opts, common.Big0)
})
if err != nil {
r.handleTaskError(task, &failedTasks, err)
return nil, nil, failedTasks, nil
tx, err = r.util.SendContractTransaction(r.listener.GetBridgeOperatorSign(), r.chainId, r.gasLimitBumpRatio, func(opts *bind.TransactOpts) (*ethtypes.Transaction, error) {
return bridgeRewardContract.SyncReward(opts, common.Big1)
})
if err != nil {
r.handleTaskError(task, &failedTasks, err)
return nil, nil, failedTasks, nil
}
}
processingTasks = append(processingTasks, task)
return
Expand Down