updated to new solidity keywords and linting
This commit is contained in:
parent
d91bfb7f8e
commit
212f60d5f1
|
@ -39,7 +39,7 @@ contract DelegationProxy is DelegationProxyInterface {
|
||||||
*/
|
*/
|
||||||
function delegatedTo(address _who)
|
function delegatedTo(address _who)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns (address)
|
returns (address)
|
||||||
{
|
{
|
||||||
return delegatedToAt(_who, block.number);
|
return delegatedToAt(_who, block.number);
|
||||||
|
@ -52,7 +52,7 @@ contract DelegationProxy is DelegationProxyInterface {
|
||||||
*/
|
*/
|
||||||
function delegationOf(address _who)
|
function delegationOf(address _who)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns(address)
|
returns(address)
|
||||||
{
|
{
|
||||||
return delegationOfAt(_who, block.number);
|
return delegationOfAt(_who, block.number);
|
||||||
|
@ -69,7 +69,7 @@ contract DelegationProxy is DelegationProxyInterface {
|
||||||
MiniMeTokenInterface _token
|
MiniMeTokenInterface _token
|
||||||
)
|
)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns(uint256 _total)
|
returns(uint256 _total)
|
||||||
{
|
{
|
||||||
return influenceOfAt(_who, _token, block.number);
|
return influenceOfAt(_who, _token, block.number);
|
||||||
|
@ -86,7 +86,7 @@ contract DelegationProxy is DelegationProxyInterface {
|
||||||
address _token
|
address _token
|
||||||
)
|
)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns(uint256 _total)
|
returns(uint256 _total)
|
||||||
{
|
{
|
||||||
return delegatedInfluenceFromAt(_who, _token, block.number, address(this));
|
return delegatedInfluenceFromAt(_who, _token, block.number, address(this));
|
||||||
|
@ -105,7 +105,7 @@ contract DelegationProxy is DelegationProxyInterface {
|
||||||
uint _block
|
uint _block
|
||||||
)
|
)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns(uint256 _total)
|
returns(uint256 _total)
|
||||||
{
|
{
|
||||||
return delegatedInfluenceFromAt(_who, _token, _block, address(this));
|
return delegatedInfluenceFromAt(_who, _token, _block, address(this));
|
||||||
|
@ -123,7 +123,7 @@ contract DelegationProxy is DelegationProxyInterface {
|
||||||
uint _block
|
uint _block
|
||||||
)
|
)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns (address directDelegate)
|
returns (address directDelegate)
|
||||||
{
|
{
|
||||||
Delegation[] storage checkpoints = delegations[_who];
|
Delegation[] storage checkpoints = delegations[_who];
|
||||||
|
@ -155,7 +155,7 @@ contract DelegationProxy is DelegationProxyInterface {
|
||||||
uint _block
|
uint _block
|
||||||
)
|
)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns(address finalDelegate)
|
returns(address finalDelegate)
|
||||||
{
|
{
|
||||||
finalDelegate = delegatedToAt(_who, _block);
|
finalDelegate = delegatedToAt(_who, _block);
|
||||||
|
@ -182,7 +182,7 @@ contract DelegationProxy is DelegationProxyInterface {
|
||||||
address _childProxy
|
address _childProxy
|
||||||
)
|
)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns(uint256 _total)
|
returns(uint256 _total)
|
||||||
{
|
{
|
||||||
Delegation[] storage checkpoints = delegations[_who];
|
Delegation[] storage checkpoints = delegations[_who];
|
||||||
|
@ -238,7 +238,7 @@ contract DelegationProxy is DelegationProxyInterface {
|
||||||
uint _block
|
uint _block
|
||||||
)
|
)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns(uint256 _total)
|
returns(uint256 _total)
|
||||||
{
|
{
|
||||||
if (delegationOfAt(_who, _block) == _who) { //is endpoint of delegation?
|
if (delegationOfAt(_who, _block) == _who) { //is endpoint of delegation?
|
||||||
|
@ -286,7 +286,7 @@ contract DelegationProxy is DelegationProxyInterface {
|
||||||
* @param _block The block number to retrieve the value at.
|
* @param _block The block number to retrieve the value at.
|
||||||
* @return The delegation being queried.
|
* @return The delegation being queried.
|
||||||
*/
|
*/
|
||||||
function _getMemoryAt(Delegation[] storage checkpoints, uint _block) internal constant returns (Delegation d) {
|
function _getMemoryAt(Delegation[] storage checkpoints, uint _block) internal view returns (Delegation d) {
|
||||||
// Case last checkpoint is the one;
|
// Case last checkpoint is the one;
|
||||||
if (_block >= checkpoints[checkpoints.length-1].fromBlock) {
|
if (_block >= checkpoints[checkpoints.length-1].fromBlock) {
|
||||||
d = checkpoints[checkpoints.length-1];
|
d = checkpoints[checkpoints.length-1];
|
||||||
|
|
|
@ -34,7 +34,7 @@ contract DelegationProxyInterface {
|
||||||
*/
|
*/
|
||||||
function delegatedTo(address _who)
|
function delegatedTo(address _who)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns (address directDelegate);
|
returns (address directDelegate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,7 +44,7 @@ contract DelegationProxyInterface {
|
||||||
*/
|
*/
|
||||||
function delegationOf(address _who)
|
function delegationOf(address _who)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns(address finalDelegate);
|
returns(address finalDelegate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -58,7 +58,7 @@ contract DelegationProxyInterface {
|
||||||
MiniMeTokenInterface _token
|
MiniMeTokenInterface _token
|
||||||
)
|
)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns(uint256 _total);
|
returns(uint256 _total);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -72,7 +72,7 @@ contract DelegationProxyInterface {
|
||||||
address _token
|
address _token
|
||||||
)
|
)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns(uint256 _total);
|
returns(uint256 _total);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -88,7 +88,7 @@ contract DelegationProxyInterface {
|
||||||
uint _block
|
uint _block
|
||||||
)
|
)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns(uint256 _total);
|
returns(uint256 _total);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -103,7 +103,7 @@ contract DelegationProxyInterface {
|
||||||
uint _block
|
uint _block
|
||||||
)
|
)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns (address directDelegate);
|
returns (address directDelegate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -117,7 +117,7 @@ contract DelegationProxyInterface {
|
||||||
uint _block
|
uint _block
|
||||||
)
|
)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns(address finalDelegate);
|
returns(address finalDelegate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -135,7 +135,7 @@ contract DelegationProxyInterface {
|
||||||
address _childProxy
|
address _childProxy
|
||||||
)
|
)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns(uint256 _total);
|
returns(uint256 _total);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -151,7 +151,7 @@ contract DelegationProxyInterface {
|
||||||
uint _block
|
uint _block
|
||||||
)
|
)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns(uint256 _total);
|
returns(uint256 _total);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ contract DelegationProxyView is DelegationProxy {
|
||||||
uint _block
|
uint _block
|
||||||
)
|
)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns(address finalDelegate)
|
returns(address finalDelegate)
|
||||||
{
|
{
|
||||||
bytes32 searchIndex = keccak256(_who, _block);
|
bytes32 searchIndex = keccak256(_who, _block);
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
pragma solidity ^0.4.21;
|
pragma solidity ^0.4.21;
|
||||||
|
|
||||||
import "./DemocracyInterface.sol";
|
import "./DemocracyInterface.sol";
|
||||||
import "./ProposalManager.sol";
|
import "./ProposalManager.sol";
|
||||||
import "./FeeRecycler.sol";
|
import "./FeeRecycler.sol";
|
||||||
|
|
||||||
|
|
||||||
contract Democracy is DemocracyInterface {
|
contract Democracy is DemocracyInterface {
|
||||||
|
|
||||||
mapping (bytes32 => Allowance) topicAllowance;
|
mapping (bytes32 => Allowance) topicAllowance;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
pragma solidity ^0.4.17;
|
pragma solidity ^0.4.21;
|
||||||
|
|
||||||
import "./DemocracyStorage.sol";
|
import "./DemocracyStorage.sol";
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
pragma solidity ^0.4.17;
|
pragma solidity ^0.4.21;
|
||||||
|
|
||||||
import "../deploy/InstanceStorage.sol";
|
import "../deploy/InstanceStorage.sol";
|
||||||
import "../token/MiniMeTokenInterface.sol";
|
import "../token/MiniMeTokenInterface.sol";
|
||||||
|
|
|
@ -79,7 +79,7 @@ contract ProposalManager is ProposalManagerInterface, Controlled {
|
||||||
|
|
||||||
function getProposal(uint _proposalId)
|
function getProposal(uint _proposalId)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns (
|
returns (
|
||||||
bytes32 topic,
|
bytes32 topic,
|
||||||
bytes32 txHash,
|
bytes32 txHash,
|
||||||
|
@ -92,7 +92,7 @@ contract ProposalManager is ProposalManagerInterface, Controlled {
|
||||||
|
|
||||||
function getProposalTxHash(uint _proposalId)
|
function getProposalTxHash(uint _proposalId)
|
||||||
public
|
public
|
||||||
constant
|
view
|
||||||
returns(bytes32)
|
returns(bytes32)
|
||||||
{
|
{
|
||||||
return proposals[_proposalId].txHash;
|
return proposals[_proposalId].txHash;
|
||||||
|
|
|
@ -50,7 +50,7 @@ contract ProposalManagerInterface {
|
||||||
event ProposalResult(uint256 _proposalId, Vote finalResult);
|
event ProposalResult(uint256 _proposalId, Vote finalResult);
|
||||||
|
|
||||||
function addProposal(bytes32 _topic, bytes32 _txHash, uint _visibilityFee) public returns (uint);
|
function addProposal(bytes32 _topic, bytes32 _txHash, uint _visibilityFee) public returns (uint);
|
||||||
function getProposal(uint _id) public constant returns (bytes32 topic, bytes32 txHash, bool approved);
|
function getProposal(uint _id) public view returns (bytes32 topic, bytes32 txHash, bool approved);
|
||||||
function voteProposal(uint _proposal, Vote _vote) public;
|
function voteProposal(uint _proposal, Vote _vote) public;
|
||||||
function tabulateVote(uint _proposal, address _delegator) public;
|
function tabulateVote(uint _proposal, address _delegator) public;
|
||||||
function tabulateVeto(uint _proposal, address _delegator) public;
|
function tabulateVeto(uint _proposal, address _delegator) public;
|
||||||
|
|
|
@ -40,7 +40,7 @@ contract TrustNetwork is TrustNetworkInterface, Controlled {
|
||||||
topics[topicId] = newTopic(vote, veto);
|
topics[topicId] = newTopic(vote, veto);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTopic(bytes32 _topicId) public constant returns (DelegationProxyInterface vote, DelegationProxyInterface veto) {
|
function getTopic(bytes32 _topicId) public view returns (DelegationProxyInterface vote, DelegationProxyInterface veto) {
|
||||||
Topic memory topic = topics[_topicId];
|
Topic memory topic = topics[_topicId];
|
||||||
vote = topic.voteDelegation;
|
vote = topic.voteDelegation;
|
||||||
veto = topic.vetoDelegation;
|
veto = topic.vetoDelegation;
|
||||||
|
|
|
@ -5,7 +5,7 @@ import "./DelegationProxyInterface.sol";
|
||||||
contract TrustNetworkInterface {
|
contract TrustNetworkInterface {
|
||||||
|
|
||||||
function addTopic(bytes32 topicId, bytes32 parentTopic) public;
|
function addTopic(bytes32 topicId, bytes32 parentTopic) public;
|
||||||
function getTopic(bytes32 _topicId) public constant returns (DelegationProxyInterface vote, DelegationProxyInterface veto);
|
function getTopic(bytes32 _topicId) public view returns (DelegationProxyInterface vote, DelegationProxyInterface veto);
|
||||||
function getVoteDelegation(bytes32 _topicId) public view returns (DelegationProxyInterface voteDelegation);
|
function getVoteDelegation(bytes32 _topicId) public view returns (DelegationProxyInterface voteDelegation);
|
||||||
function getVetoDelegation(bytes32 _topicId) public view returns (DelegationProxyInterface vetoDelegation);
|
function getVetoDelegation(bytes32 _topicId) public view returns (DelegationProxyInterface vetoDelegation);
|
||||||
}
|
}
|
Loading…
Reference in New Issue