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(smart-contracts): UP token contract #13875

Merged
merged 27 commits into from
May 28, 2024
Merged

feat(smart-contracts): UP token contract #13875

merged 27 commits into from
May 28, 2024

Conversation

clemsos
Copy link
Member

@clemsos clemsos commented May 21, 2024

Description

This PR adds the UnlockDiscountToken ERC20 contract

Need to rebase once #13874 s merged

Issues

Fixes #
Refs #

Checklist:

  • 1 PR, 1 purpose: my Pull Request applies to a single purpose
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the docs to reflect my changes if applicable
  • I have added tests (and stories for frontend components) that prove my fix is effective or that my feature works
  • I have performed a self-review of my own code
  • If my code involves visual changes, I am adding applicable screenshots to this thread

Release Note Draft Snippet

@clemsos clemsos requested a review from julien51 May 21, 2024 15:02
@cla-bot cla-bot bot added the cla-signed label May 21, 2024
__GovernorTimelockControl_init(_timelock);

// default quorum set to 30k
_quorum = 30000e18;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nouvelle syntax?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quorum should be 3k NOT 30k.

TimelockControllerUpgradeable _timelock
) public initializer {
__Governor_init("UnlockProtocolGovernor");
__GovernorSettings_init(43200 /* 6 day */, 43200 /* 6 days */, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this in seconds? If so this is not 6 days! please use 6* 24 * 60 * 60 for clarty.

@@ -12,15 +12,15 @@ const { getEvent } = require('@unlock-protocol/hardhat-helpers')

const PROPOSER_ROLE = ethers.keccak256(ethers.toUtf8Bytes('PROPOSER_ROLE'))

describe('UnlockProtocolGovernor', () => {
// default values
const SIX_DAYS = 43200 // in blocks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hum, I think we should not use blocks because that's different based on what chain we go for. Can we use seconds rather?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just moved the gov and erc20 votes to use timestamps instead of blocks

@clemsos clemsos requested a review from julien51 May 22, 2024 14:34
Comment on lines 41 to 43
// default quorum set to 3000
_quorum = 3000e18;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use GovernorVotesQuorumFraction instead

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok added relative quorum

@clemsos
Copy link
Member Author

clemsos commented May 24, 2024

Here the entire UP supply has been transferred to the Swap contract on creation https://sepolia.basescan.org/tx/0x0e7f60f86a244b68101267d606354816b5fb42f871f640c207f609c4b8740d82

_mint(preMinter, TOTAL_SUPPLY * 10 ** decimals());
}

// required to base votes on timestamp instead of blocks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@julien51 julien51 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I think this is good!

clemsos and others added 2 commits May 28, 2024 11:10
Co-authored-by: Julien Genestoux <julien.genestoux@gmail.com>
@clemsos clemsos merged commit cd3123d into master May 28, 2024
3 checks passed
@clemsos
Copy link
Member Author

clemsos commented May 28, 2024

@clemsos clemsos deleted the up-token branch May 28, 2024 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants