I modified it a bit and I am playing now with more voters than just the deployer / in my case alice.
For example created the following:
governanceToken - ERC20Votes
split the token between two addresses (alice bob).
when I call castVoteWithReason the vote gets executed, but the voteWeight I get back for Bob - 2nd voter is always 0, and not his actual voteWeight - which is his balance of governance Token...
I guess I am missing some scope here, so would like more context... where can I read more about it.
You need to advance the blocks until the proposal becomes "active". The proposal becomes active in your case 1 block after proposing.
I believe you need to mine 2 blocks instead of just 1 because the votes snapshot refers to the end of the block not the beginning, so it needs to be completely mined before the governor can query votes at that block.
By default, token balance does not account for voting power. This makes transfers cheaper. The downside is that it requires users to delegate to themselves in order to activate checkpoints and have their voting power tracked.
if we pass 3 contract address as targets in proposal, when we want execute transactions, what will happen if first contract don't has fallback function for receive ether ?