Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Block liquidationInitiator fallback revert on purchaseSignerBondsAtAuction #524

Merged
merged 3 commits into from
Mar 16, 2020

Conversation

NicholasDotSol
Copy link
Contributor

@NicholasDotSol NicholasDotSol commented Mar 13, 2020

closes: #503, #504

  • Send does not raise a revert, so if ether is sent
    to a reverting fallback the system won't halt.

  • the remainder of the contract balance is cent after the first half to avoid a 1-wei remainder on odd initial balances.

NicholasDotSol and others added 3 commits March 12, 2020 22:27
Send does not raise a revert, so if ether is sent
to a reverting fallback the system won't halt.
Transfering the contract balance prevents a
1-wei remainder from being left behind.
Copy link
Contributor

@Shadowfiend Shadowfiend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handles the immediate problem, so let's roll it on in.

} else {
// There will always be a liquidation initiator.
uint256 split = contractEthBalance.div(2);
_d.pushFundsToKeepGroup(split);
initiator.transfer(split);
/* solium-disable-next-line security/no-send */
initiator.send(address(this).balance);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No loss of functionality here so I'm good, but a couple of questions:

  • Do we want to leave space for the initiator to pull their funds manually in case this fails? This could use a raw .call() since the initiator would be paying for their withdrawal.
  • Do we want to globally disable the security/no-send rule?

No need for further action here until we figure out how we want to tackle the inherent issues with the initiator split, though.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @Shadowfiend noted, the method could also bit split in to parts: (1) first part liquidating the deposit and pushing funds to keep (secure) (2) a method that allows the initiator to pull the deposit contracts balance. this would avoid a case where eth is locked in the contract because send fails (which should be unlikely).

@Shadowfiend Shadowfiend merged commit 249f087 into master Mar 16, 2020
@Shadowfiend Shadowfiend deleted the liq-initiator-revert branch March 16, 2020 03:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

liquidationInitiator fallback revert can block purchaseSignerBondsAtAuction
3 participants