You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I hope you're doing great. I have been tinkering with ERC20Votes and creating a DAO for my Vendor contract. The issue I'm facing is that whenever I try to delegate my GovernanceToken contract to the deployer and check the numCheckpoints function it shows Checkpoint: 0.
If I'm correct, upon successful delegation to the deployer or any address the checkpoint should be at 1.
Here are my VendorGovernanceToken.sol contract and my deploy-governance-token.js script.
VendorGovernanceToken.sol
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
contract VendorGovernanceToken is ERC20, ERC20Permit, ERC20Votes {
constructor() ERC20("GovernanceToken", "GNT") ERC20Permit("GovernanceToken") {}
// The following functions are overrides required by Solidity.
function _update(address from, address to, uint256 value) internal override(ERC20, ERC20Votes) {
super._update(from, to, value);
}
function nonces(address owner) public view override(ERC20Permit, Nonces) returns (uint256) {
return super.nonces(owner);
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I hope you're doing great. I have been tinkering with
ERC20Votes
and creating a DAO for myVendor
contract. The issue I'm facing is that whenever I try to delegate myGovernanceToken
contract to the deployer and check thenumCheckpoints
function it showsCheckpoint: 0
.If I'm correct, upon successful delegation to the deployer or any address the checkpoint should be at 1.
Here are my
VendorGovernanceToken.sol
contract and mydeploy-governance-token.js
script.Any help will be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions