2

I'm using liquid democracy contract from https://www.ethereum.org/dao

This is the relationship.

Shareholder Association has this definition when pointing to liquid democracy contract.

contract token {
    mapping (address => uint256) public voteWeight;
    uint public numberOfDelegationRounds;

    function balanceOf(address member) constant returns (uint256 balance) {
        if (numberOfDelegationRounds < 3)
            return 0;
        else
            return this.voteWeight(member);
    }
}

then liquid democracy contract points to token contract and defines its connection as this.

contract token {
    mapping (address => uint256) public balanceOf;
}

The line in Shareholder Association below returns garbage data.

uint voteWeight = sharesTokenAddress.balanceOf(v.voter);

something like this which is big number.

76181730938387481504298103224485865201289833135200371729261377095349320967255

I had to combine logic from those contracts into one for it to work. I'm not using token contract anymore for this though as my contracts use 1 token per user and I have just internally implemented it giving each user one vote.

Of course I would like to reuse the code and be able to execute this idea like shown on the Ethereum site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.