Hi, Tally does not allow me to delegates tokens.
I deployed a governor and a ERC20 token on Etherium Sepolia. Then I deployed a DAO with Tally.xyz using my governor and my token, but when I want to delegate token from tally does not allow me to do that.
My script deploy is the following:
const MyToken = await hre.ethers.getContractFactory("MyToken");
const mytoken = await MyToken.deploy();
await mytoken.deployed();
const tokenAddress = mytoken.address;
console.log("Mytoken deployed to:", tokenAddress);
//This is the wallet from I deployed MyToken contract!!
const addresWallet="0xADDRESS";
const balanceWallet = await mytoken.balanceOf(addresWallet);
const votingPowerWallet = await mytoken.delegates(addresWallet);
console.log("my wallet voting power: ", votingPowerWallet);
console.log("my wallet balance: ", balanceWallet);
const Governor = await hre.ethers.getContractFactory("MyGovernor");
const governor = await Governor.deploy(tokenAddress);
await governor.deployed();
console.log("Governor deployed to:", governor.address);
This script prints
Mytoken deployed to: 0xxx
my wallet voting power: 0x0000000000000000000000000000000000000000
my wallet balance: BigNumber { value: "1000000000000000000000" }
Governor deployed to: 0xxx
I want to know why the address I deployed from has balance but no voting power.
Could someone clarify this for me please?
Here are my contracts:
pragma solidity >=0.8.13;
import "hardhat/console.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
contract MyToken is ERC20, ERC20Permit, ERC20Votes {
constructor() ERC20("TPPFI10", "TPP10") ERC20Permit("MyToken") {
_mint(msg.sender, 1000*10**18);
}
// The functions below are overrides required by Solidity.
function _afterTokenTransfer(address from, address to, uint256 amount)
internal
override(ERC20, ERC20Votes)
{
super._afterTokenTransfer(from, to, amount);
}
function _mint(address to, uint256 amount)
internal
override(ERC20, ERC20Votes)
{
super._mint(to, amount);
}
function _burn(address account, uint256 amount)
internal
override(ERC20, ERC20Votes)
{
super._burn(account, amount);
}
}
pragma solidity >=0.8.13;
import "@openzeppelin/contracts/governance/Governor.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorVotes.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol";
contract MyGovernor is Governor, GovernorCountingSimple, GovernorVotes, GovernorVotesQuorumFraction {
constructor(IVotes _token)
Governor("MyGovernor")
GovernorVotes(_token)
GovernorVotesQuorumFraction(4)
{}
function votingDelay() public pure override returns (uint256) {
return 10; // 2 minute
}
function votingPeriod() public pure override returns (uint256) {
return 900; // 1 hour
}
function proposalThreshold() public pure override returns (uint256) {
return 0;
}
// The following functions are overrides required by Solidity.
function quorum(uint256 blockNumber)
public
view
override(IGovernor, GovernorVotesQuorumFraction)
returns (uint256)
{
return super.quorum(blockNumber);
}
}
Thanks in advance,