Skip to content

Commit 9c75992

Browse files
committed
fix: rounding error in GNS
1 parent 6a87193 commit 9c75992

File tree

1 file changed

+6
-3
lines changed
  • packages/contracts/contracts/discovery

1 file changed

+6
-3
lines changed

packages/contracts/contracts/discovery/GNS.sol

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -740,10 +740,13 @@ abstract contract GNS is GNSV3Storage, GraphUpgradeable, IGNS, Multicall {
740740
return _tokens;
741741
}
742742

743-
// Tax on the total bonding curve funds
744-
uint256 taxOnOriginal = _tokens.mul(_curationTaxPercentage).div(MAX_PPM);
745743
// Total after the tax
746-
uint256 totalWithoutOwnerTax = _tokens.sub(taxOnOriginal);
744+
uint256 totalWithoutOwnerTax = uint256(MAX_PPM)
745+
.sub(_curationTaxPercentage)
746+
.mul(_tokens)
747+
.div(MAX_PPM);
748+
// Tax on the total bonding curve funds
749+
uint256 taxOnOriginal = _tokens.sub(totalWithoutOwnerTax);
747750
// The portion of tax that the owner will pay
748751
uint256 ownerTax = taxOnOriginal.mul(ownerTaxPercentage).div(MAX_PPM);
749752

0 commit comments

Comments
 (0)