Skip to content

Commit 4d028de

Browse files
authored
Merge pull request #522 from graphprotocol/audit/gns-ownership-n01
Audit: [N01] Lack of input validation
2 parents 78b1e39 + 321c29b commit 4d028de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

contracts/discovery/GNS.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,9 @@ contract GNS is GNSV2Storage, GraphUpgradeable, IGNS, Multicall {
540540
override
541541
returns (uint256, uint256)
542542
{
543-
SubgraphData storage subgraphData = _getSubgraphData(_subgraphID);
543+
// Get subgraph or revert if not published
544+
// It does not make sense to convert signal from a disabled or non-existing one
545+
SubgraphData storage subgraphData = _getSubgraphOrRevert(_subgraphID);
544546
uint256 vSignal = nSignalToVSignal(_subgraphID, _nSignalIn);
545547
uint256 tokensOut = curation().signalToTokens(subgraphData.subgraphDeploymentID, vSignal);
546548
return (vSignal, tokensOut);

0 commit comments

Comments
 (0)