diff --git a/contracts/discovery/GNS.sol b/contracts/discovery/GNS.sol index 9af60ba2f..68408279d 100644 --- a/contracts/discovery/GNS.sol +++ b/contracts/discovery/GNS.sol @@ -731,8 +731,13 @@ abstract contract GNS is GNSV3Storage, GraphUpgradeable, IGNS, Multicall { address _owner, uint32 _curationTaxPercentage ) internal returns (uint256) { + // If curation or owner tax are zero, we don't need to charge owner tax + // so the amount of tokens to signal will remain the same. + // Note if owner tax is zero but curation tax is nonzero, the curation tax + // will still be charged (in Curation or L2Curation) - this function just calculates + // the owner's additional tax. if (_curationTaxPercentage == 0 || ownerTaxPercentage == 0) { - return 0; + return _tokens; } // Tax on the total bonding curve funds diff --git a/test/gns.test.ts b/test/gns.test.ts index 98199cd52..b729a5c08 100644 --- a/test/gns.test.ts +++ b/test/gns.test.ts @@ -420,6 +420,11 @@ describe('L1GNS', () => { await publishNewVersion(me, subgraph.id, newSubgraph1, gns, curation) }) + it('should publish a new version on an existing subgraph when owner tax is zero', async function () { + await gns.connect(governor.signer).setOwnerTaxPercentage(0) + await publishNewVersion(me, subgraph.id, newSubgraph1, gns, curation) + }) + it('should publish a new version on an existing subgraph with no current signal', async function () { const emptySignalSubgraph = await publishNewSubgraph(me, buildSubgraph(), gns) await publishNewVersion(me, emptySignalSubgraph.id, newSubgraph1, gns, curation) diff --git a/test/l2/l2GNS.test.ts b/test/l2/l2GNS.test.ts index 728decacf..996f355c7 100644 --- a/test/l2/l2GNS.test.ts +++ b/test/l2/l2GNS.test.ts @@ -165,6 +165,11 @@ describe('L2GNS', () => { await publishNewVersion(me, subgraph.id, newSubgraph1, gns, curation) }) + it('should publish a new version on an existing subgraph when owner tax is zero', async function () { + await gns.connect(governor.signer).setOwnerTaxPercentage(0) + await publishNewVersion(me, subgraph.id, newSubgraph1, gns, curation) + }) + it('should publish a new version on an existing subgraph with no current signal', async function () { const emptySignalSubgraph = await publishNewSubgraph(me, buildSubgraph(), gns) await publishNewVersion(me, emptySignalSubgraph.id, newSubgraph1, gns, curation)