Skip to content

Commit 350aa1f

Browse files
abarmatdavekay100
authored andcommitted
curation: rename graph signal token to graph curation share
1 parent 6343062 commit 350aa1f

File tree

8 files changed

+31
-36
lines changed

8 files changed

+31
-36
lines changed

.soliumignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ contracts/token/IGraphToken.sol
66
contracts/upgrades/GraphProxy.sol
77
contracts/rewards/RewardsManager.sol
88
contracts/tests/ens
9-
contracts/curation/IGraphSignalToken.sol
9+
contracts/curation/IGraphCurationToken.sol
1010
contracts/staking/libs/LibFixedMath.sol
1111
contracts/tests/testnet/GSRManager.sol

contracts/curation/Curation.sol

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import "../upgrades/GraphUpgradeable.sol";
77

88
import "./CurationStorage.sol";
99
import "./ICuration.sol";
10-
import "./GraphSignalToken.sol";
10+
import "./GraphCurationToken.sol";
1111

1212
/**
1313
* @title Curation contract
@@ -16,9 +16,9 @@ import "./GraphSignalToken.sol";
1616
* subgraph deployment they curate.
1717
* A curators deposit goes to a curation pool along with the deposits of other curators,
1818
* only one such pool exists for each subgraph deployment.
19-
* The contract mints Graph Signal Tokens (GST) according to a bonding curve for each individual
19+
* The contract mints Graph Curation Shares (GCS) according to a bonding curve for each individual
2020
* curation pool where GRT is deposited.
21-
* Holders can burn GST tokens using this contract to get GRT tokens back according to the
21+
* Holders can burn GCS using this contract to get GRT tokens back according to the
2222
* bonding curve.
2323
*/
2424
contract Curation is CurationV1Storage, GraphUpgradeable, ICuration {
@@ -196,11 +196,11 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration {
196196
curationPool.reserveRatio = defaultReserveRatio;
197197

198198
// If no signal token for the pool - create one
199-
if (address(curationPool.gst) == address(0)) {
199+
if (address(curationPool.gcs) == address(0)) {
200200
// TODO: the gas cost of deploying the subgraph token can be greatly optimized
201201
// by deploying a proxy each time, sharing the same implementation
202-
curationPool.gst = IGraphSignalToken(
203-
address(new GraphSignalToken("GST", address(this)))
202+
curationPool.gcs = IGraphCurationToken(
203+
address(new GraphCurationToken(address(this)))
204204
);
205205
}
206206
}
@@ -216,7 +216,7 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration {
216216
"Cannot transfer tokens to deposit"
217217
);
218218

219-
// Exchange GRT tokens for GST of the subgraph pool
219+
// Exchange GRT tokens for GCS of the subgraph pool
220220
uint256 signal = _mintSignal(curator, _subgraphDeploymentID, _tokens);
221221

222222
emit Signalled(curator, _subgraphDeploymentID, _tokens, signal);
@@ -293,10 +293,10 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration {
293293
view
294294
returns (uint256)
295295
{
296-
if (address(pools[_subgraphDeploymentID].gst) == address(0)) {
296+
if (address(pools[_subgraphDeploymentID].gcs) == address(0)) {
297297
return 0;
298298
}
299-
return pools[_subgraphDeploymentID].gst.balanceOf(_curator);
299+
return pools[_subgraphDeploymentID].gcs.balanceOf(_curator);
300300
}
301301

302302
/**
@@ -310,10 +310,10 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration {
310310
view
311311
returns (uint256)
312312
{
313-
if (address(pools[_subgraphDeploymentID].gst) == address(0)) {
313+
if (address(pools[_subgraphDeploymentID].gcs) == address(0)) {
314314
return 0;
315315
}
316-
return pools[_subgraphDeploymentID].gst.totalSupply();
316+
return pools[_subgraphDeploymentID].gcs.totalSupply();
317317
}
318318

319319
/**
@@ -424,7 +424,7 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration {
424424
// Update GRT tokens held as reserves
425425
curationPool.tokens = curationPool.tokens.add(_tokens);
426426
// Mint signal to the curator
427-
curationPool.gst.mint(_curator, signal);
427+
curationPool.gcs.mint(_curator, signal);
428428

429429
return signal;
430430
}
@@ -449,7 +449,7 @@ contract Curation is CurationV1Storage, GraphUpgradeable, ICuration {
449449
// Update GRT tokens held as reserves
450450
curationPool.tokens = curationPool.tokens.sub(outTokens);
451451
// Burn signal from curator
452-
curationPool.gst.burnFrom(_curator, _signal);
452+
curationPool.gcs.burnFrom(_curator, _signal);
453453

454454
return (tokens, withdrawalFees);
455455
}

contracts/curation/GraphSignalToken.sol renamed to contracts/curation/GraphCurationToken.sol

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,19 @@ import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
55
import "../governance/Governed.sol";
66

77
/**
8-
* @title GraphSignalToken contract
9-
* @dev This is the implementation of the Curation Signal ERC20 token (GST).
10-
* GST tokens are created for each subgraph deployment curated in the Curation contract.
11-
* The Curation contract is the owner of GST tokens and the only one allowed to mint or
12-
* burn them. GST tokens are transferrable and their holders can do any action allowed
8+
* @title GraphCurationToken contract
9+
* @dev This is the implementation of the Curation ERC20 token (GCS).
10+
* GCS are created for each subgraph deployment curated in the Curation contract.
11+
* The Curation contract is the owner of GCS tokens and the only one allowed to mint or
12+
* burn them. GCS tokens are transferrable and their holders can do any action allowed
1313
* in a standard ERC20 token implementation except for burning them.
1414
*/
15-
contract GraphSignalToken is ERC20, Governed {
15+
contract GraphCurationToken is ERC20, Governed {
1616
/**
17-
* @dev Graph Token Contract Constructor.
18-
* @param _symbol Token symbol
17+
* @dev Graph Curation Token Contract Constructor.
1918
* @param _owner Address of the contract issuing this token
2019
*/
21-
constructor(string memory _symbol, address _owner) public ERC20("Graph Signal Token", _symbol) {
20+
constructor(address _owner) public ERC20("Graph Curation Share", "GCS") {
2221
Governed._initialize(_owner);
2322
}
2423

contracts/curation/ICuration.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
pragma solidity ^0.6.12;
22

3-
import "./IGraphSignalToken.sol";
3+
import "./IGraphCurationToken.sol";
44

55
interface ICuration {
66
// -- Pool --
77

88
struct CurationPool {
99
uint256 tokens; // GRT Tokens stored as reserves for the subgraph deployment
1010
uint32 reserveRatio; // Ratio for the bonding curve
11-
IGraphSignalToken gst; // Signal token contract for this curation pool
11+
IGraphCurationToken gcs; // Curation token contract for this curation pool
1212
}
1313

1414
// -- Configuration --

contracts/curation/IGraphSignalToken.sol renamed to contracts/curation/IGraphCurationToken.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ pragma solidity ^0.6.12;
22

33
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
44

5-
interface IGraphSignalToken is IERC20 {
5+
interface IGraphCurationToken is IERC20 {
66
function burnFrom(address _account, uint256 _amount) external;
77

88
function mint(address _to, uint256 _amount) external;

contracts/discovery/GNS.sol

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ contract GNS is Managed {
335335
isPublished(_graphAccount, _subgraphNumber),
336336
"GNS: Cannot deprecate a subgraph which does not exist"
337337
);
338-
bytes32 subgraphDeploymentID = subgraphs[_graphAccount][_subgraphNumber];
339338
delete subgraphs[_graphAccount][_subgraphNumber];
340339
emit SubgraphDeprecated(_graphAccount, _subgraphNumber);
341340

@@ -457,10 +456,7 @@ contract GNS is Managed {
457456
* @param _graphAccount Account that is deprecating their name curation
458457
* @param _subgraphNumber Subgraph number
459458
*/
460-
function _disableNameSignal(
461-
address _graphAccount,
462-
uint256 _subgraphNumber
463-
) private {
459+
function _disableNameSignal(address _graphAccount, uint256 _subgraphNumber) private {
464460
NameCurationPool storage namePool = nameSignals[_graphAccount][_subgraphNumber];
465461
// If no nSignal, then no need to burn vSignal
466462
if (namePool.nSignal != 0) {

test/curation/curation.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ describe('Curation', () => {
444444
it('should mint less signal every time due to the bonding curve', async function () {
445445
const tokensToDepositMany = [
446446
toGRT('1000'), // should mint if we start with number above minimum deposit
447-
toGRT('1000'), // every time it should mint less GST due to bonding curve...
447+
toGRT('1000'), // every time it should mint less GCS due to bonding curve...
448448
toGRT('1000'),
449449
toGRT('1000'),
450450
toGRT('2000'),
@@ -471,13 +471,13 @@ describe('Curation', () => {
471471
})
472472

473473
it('should mint when using the edge case of linear function', async function () {
474-
// Setup edge case like linear function: 1 GRT = 1 GST
474+
// Setup edge case like linear function: 1 GRT = 1 GCS
475475
await curation.setMinimumCurationDeposit(toGRT('1'))
476476
await curation.setDefaultReserveRatio(1000000)
477477

478478
const tokensToDepositMany = [
479479
toGRT('1000'), // should mint if we start with number above minimum deposit
480-
toGRT('1000'), // every time it should mint less GST due to bonding curve...
480+
toGRT('1000'), // every time it should mint less GCS due to bonding curve...
481481
toGRT('1000'),
482482
toGRT('1000'),
483483
toGRT('2000'),

test/gns.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ describe('GNS', () => {
838838
it('should mint less signal every time due to the bonding curve', async function () {
839839
const tokensToDepositMany = [
840840
toGRT('1000'), // should mint if we start with number above minimum deposit
841-
toGRT('1000'), // every time it should mint less GST due to bonding curve...
841+
toGRT('1000'), // every time it should mint less GCS due to bonding curve...
842842
toGRT('1'), // should mint below minimum deposit
843843
toGRT('1000'),
844844
toGRT('1000'),
@@ -881,7 +881,7 @@ describe('GNS', () => {
881881

882882
const tokensToDepositMany = [
883883
toGRT('1000'), // should mint if we start with number above minimum deposit
884-
toGRT('1000'), // every time it should mint less GST due to bonding curve...
884+
toGRT('1000'), // every time it should mint less GCS due to bonding curve...
885885
toGRT('1000'),
886886
toGRT('1000'),
887887
toGRT('2000'),

0 commit comments

Comments
 (0)