Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove asset holder allowlist, with additional fixes #864

Merged
merged 21 commits into from
Dec 7, 2023
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
bcf31e9
feat: remove asset holder allowlist
pcarranzav Nov 15, 2022
2e8c499
fix: remove setAssetHolder call from config files
tmigone Nov 16, 2022
36308c3
fix: a few details for asset holder deprecation
pcarranzav Nov 24, 2022
b56af5d
fix: improvements from Trust audit (TRST-L-1 and recommendations)
pcarranzav Feb 17, 2023
225be78
test: fix the case when collecting zero fees
pcarranzav Feb 17, 2023
c2fdebb
Merge pull request #791 from graphprotocol/pcv/asset-holder-trust-fixes
pcarranzav Feb 23, 2023
765d43f
chore: add Trust audit report
pcarranzav Feb 23, 2023
194fb4f
Merge branch 'dev' into pcv/remove-asset-holder-check
pcarranzav Aug 2, 2023
04a42bc
fix: remove assetHolders getter
pcarranzav Aug 3, 2023
4b334cb
test: remove a leftover setAssetHolder call
pcarranzav Aug 3, 2023
d3b626c
fix: use a bracket scope to avoid stack too deep
pcarranzav Sep 5, 2023
c090c63
fix: typo
pcarranzav Sep 5, 2023
abe55a1
test: fix a case where it still expected an event
pcarranzav Sep 6, 2023
bf1aa37
fix: require that an allocation is open for an epoch before collecting
pcarranzav Oct 11, 2023
22e838f
fix: enforce a minimum of 1 GRT when delegating to an indexer for the…
pcarranzav Oct 11, 2023
ef55d45
fix: enforce minimum delegation when receiving from L1
pcarranzav Oct 11, 2023
3882b35
fix: enforce minimum delegation in all cases, including undelegation
pcarranzav Oct 12, 2023
f9af7eb
fix: round up when calculating curation fees and the protocol tax (OZ…
pcarranzav Nov 9, 2023
821c93a
fix: clean up the check for remaining delegation (OZ N-01)
pcarranzav Nov 10, 2023
842445d
fix: add a rounding error protection when receiving subgraphs or sign…
pcarranzav Nov 22, 2023
afe7f9f
fix: add comment on not being able to revert
pcarranzav Nov 24, 2023
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
33 changes: 19 additions & 14 deletions test/staking/allocation.test.ts
Original file line number Diff line number Diff line change
@@ -199,7 +199,7 @@ describe('Staking:Allocation', () => {
}

// This function tests collect with state updates
const shouldCollect = async (tokensToCollect: BigNumber) => {
const shouldCollect = async (tokensToCollect: BigNumber, expectEvent = true) => {
// Before state
const beforeTokenSupply = await grt.totalSupply()
const beforePool = await curation.pools(subgraphDeploymentID)
@@ -220,18 +220,23 @@ describe('Staking:Allocation', () => {

// Collect tokens from allocation
const tx = staking.connect(assetHolder.signer).collect(tokensToCollect, allocationID)
await expect(tx)
.emit(staking, 'AllocationCollected')
.withArgs(
indexer.address,
subgraphDeploymentID,
await epochManager.currentEpoch(),
tokensToCollect,
allocationID,
assetHolder.address,
curationFees,
rebateFees,
)
if (expectEvent) {
await expect(tx)
.emit(staking, 'AllocationCollected')
.withArgs(
indexer.address,
subgraphDeploymentID,
await epochManager.currentEpoch(),
tokensToCollect,
allocationID,
assetHolder.address,
curationFees,
rebateFees,
)
} else {
await expect(tx).to.not.be.reverted
await expect(tx).to.not.emit(staking, 'AllocationCollected')
}

// After state
const afterTokenSupply = await grt.totalSupply()
@@ -524,7 +529,7 @@ describe('Staking:Allocation', () => {
})

it('should collect zero tokens', async function () {
await shouldCollect(toGRT('0'))
await shouldCollect(toGRT('0'), false)
})

it('should collect from a settling allocation but reject after dispute period', async function () {