Skip to content

Subgraph split signal to multiple versions #526

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

Closed
wants to merge 60 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d03b31b
initial implementation for versions
jona Nov 17, 2021
520723a
use version mapping in SubgraphData
jona Nov 17, 2021
9aee4ae
get tokens for each deployment, nSignalToTokens back to view
jona Nov 18, 2021
be9fa59
update subgraphData.vSignal
jona Nov 19, 2021
8bd9cc8
getSubgraphVersion function
jona Nov 19, 2021
0236c55
add tests for subgraph versions
jona Nov 19, 2021
8648f34
finalizeSubgraphUpgrade function
jona Nov 22, 2021
9b92604
use BigInt for test numbers
jona Nov 22, 2021
77d96af
finalizeSubgraphUpgrade should burn all and then mint
jona Nov 22, 2021
c97b420
update comment
jona Nov 23, 2021
76839b7
fix token assignment
jona Nov 23, 2021
305d524
do not reset nSignal on publishNewVersion
jona Nov 24, 2021
9537b2b
return vSignal to full amount
jona Nov 24, 2021
4bd69f3
no need for variable
jona Nov 24, 2021
413df02
vSignalTotal needed for event
jona Nov 24, 2021
7a53966
update burnSignal and deprecateSubgraph tests
jona Nov 24, 2021
e787a27
move version subgraph deployment IDs every time
jona Nov 29, 2021
612130a
check version subgraph deployment ids
jona Nov 29, 2021
4f08e0b
test burn after new version and mint
jona Nov 29, 2021
56e8c6d
remove .only
jona Nov 29, 2021
631d13f
add VersionType enum
jona Dec 1, 2021
4fd5bc3
test finalizeSubgraphUpgrade revert
jona Dec 2, 2021
f218661
update comments
jona Dec 3, 2021
1b23d14
Update GNS.sol
jona Dec 3, 2021
13c0dd8
fix: correct typos
abarmat Oct 30, 2021
7b04cbe
refactor: use curator variable instead of msg.sender
abarmat Oct 30, 2021
c48a840
fix: validate nSignalToTokens reverting when subgraph is not published
abarmat Oct 30, 2021
15b564f
fix: correct function doc
abarmat Oct 29, 2021
e7f7589
feat: update subgraph authorization policy to only allow the NFT owne…
abarmat Oct 30, 2021
a9a91c6
fix: update the target deployment even if the Subgraph has never mint…
abarmat Nov 10, 2021
b0e2dc2
refactor: use SubgraphPublished event
abarmat Nov 10, 2021
8d959fe
chore: update deployment script to initialize the new GNS
abarmat Nov 10, 2021
2066d67
docs: add audit report for transferrable subgraph
abarmat Dec 1, 2021
fe5608c
fix: run yarn build if build/types are missing (#516)
glmaljkovich Oct 14, 2021
9fbb090
refactor: updates to facilitate local network testing (#517)
fordN Oct 21, 2021
94db4d7
Use a minimal proxy for the curation shares ERC20 (#505)
abarmat Nov 29, 2021
196726c
test: make check optional when emitting SubgraphUpgraded
abarmat Dec 1, 2021
a6c0b83
docs: add audit report for minimal proxy to reduce gas cost of curation
abarmat Dec 1, 2021
dc3f822
fix revert tests
jona Dec 3, 2021
c71eede
add test from rebase
jona Dec 3, 2021
7ad777e
add natspec, update equality check, update error message
jona Dec 5, 2021
fcee8e7
update revert message test
jona Dec 5, 2021
0acb399
Merge branch 'dev' into jona/subgraph-versions
jona Dec 5, 2021
578bf07
use .add
jona Dec 6, 2021
b4870ff
remove import console
jona Dec 6, 2021
e6035b1
remove new version after deployment ID assignment
jona Dec 7, 2021
4a04a02
check if nsignal is > 0, null out subgraphDeploymentID on deprecation
jona Dec 7, 2021
037df5d
add scenario tests for gns
jona Dec 7, 2021
f67c1c7
after div subtract to more accurate remainder
jona Dec 8, 2021
be69615
remove noop
jona Dec 8, 2021
9c31922
divide by 2 in tokensToNSignal
jona Dec 8, 2021
6514834
_checkBancorThreshold function
jona Dec 10, 2021
47f8e46
return total vSignal
jona Dec 10, 2021
9169d8d
use _checkBancorThreshold
jona Dec 10, 2021
99006a3
getCurationPoolReserveRatio function
jona Dec 10, 2021
5d0fe39
use vSignalTotal
jona Dec 13, 2021
654d23d
add natspec for _checkBancorThreshold
jona Dec 13, 2021
3f89181
add whitespace
jona Dec 13, 2021
85712dd
test for burn after publish new version
jona Dec 13, 2021
5d6f2d2
try burn, if it fails burn full signal
jona Dec 13, 2021
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
14 changes: 14 additions & 0 deletions contracts/curation/Curation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,20 @@ contract Curation is CurationV1Storage, GraphUpgradeable {
return pools[_subgraphDeploymentID].tokens;
}

/**
* @dev Get the reserve ratio for curation pool.
* @param _subgraphDeploymentID Subgraph deployment curation poool
* @return Reserve ratio for curation pool
*/
function getCurationPoolReserveRatio(bytes32 _subgraphDeploymentID)
external
view
override
returns (uint32)
{
return pools[_subgraphDeploymentID].reserveRatio;
}

/**
* @dev Calculate amount of signal that can be bought with tokens in a curation pool.
* This function considers and excludes the deposit tax.
Expand Down
5 changes: 5 additions & 0 deletions contracts/curation/ICuration.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ interface ICuration {

function getCurationPoolTokens(bytes32 _subgraphDeploymentID) external view returns (uint256);

function getCurationPoolReserveRatio(bytes32 _subgraphDeploymentID)
external
view
returns (uint32);

function tokensToSignal(bytes32 _subgraphDeploymentID, uint256 _tokensIn)
external
view
Expand Down
Loading