Skip to content

Commit

Permalink
Use infra 08 (#552)
Browse files Browse the repository at this point in the history
* use infra 07

* fix genericshcme test

* solc v 0.4.25

* add return at balanceOfStakingToken
  • Loading branch information
orenyodfat authored Oct 9, 2018
1 parent 78d90ae commit a347f8e
Show file tree
Hide file tree
Showing 50 changed files with 210 additions and 123 deletions.
2 changes: 1 addition & 1 deletion contracts/Migrations.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;


contract Migrations {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "../universalSchemes/UniversalScheme.sol";
import "@daostack/infra/contracts/VotingMachines/GenesisProtocol.sol";


contract GenesisProtocolCallbacks is GenesisProtocolCallbacksInterface {
contract VotingMachineCallbacks is VotingMachineCallbacksInterface {

struct ProposalInfo {
uint blockNumber; // the proposal's block number
Expand Down Expand Up @@ -67,4 +67,8 @@ contract GenesisProtocolCallbacks is GenesisProtocolCallbacksInterface {
return ControllerInterface(avatar.owner()).externalTokenTransfer(_stakingToken,_beneficiary,_amount,address(avatar));
}

function balanceOfStakingToken(StandardToken _stakingToken,bytes32 _proposalId) external view returns(uint) {
Avatar avatar = proposalsInfo[_proposalId].avatar;
return _stakingToken.balanceOf(address(avatar));
}
}
2 changes: 1 addition & 1 deletion contracts/controller/Avatar.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "@daostack/infra/contracts/Reputation.sol";
import "./DAOToken.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/controller/Controller.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "./Avatar.sol";
import "../globalConstraints/GlobalConstraintInterface.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/controller/ControllerInterface.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "./Avatar.sol";
import "../globalConstraints/GlobalConstraintInterface.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/controller/DAOToken.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "openzeppelin-solidity/contracts/token/ERC20/MintableToken.sol";
import "openzeppelin-solidity/contracts/token/ERC20/BurnableToken.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/controller/UController.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "./Avatar.sol";
import "../globalConstraints/GlobalConstraintInterface.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/globalConstraints/GlobalConstraintInterface.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;


contract GlobalConstraintInterface {
Expand Down
2 changes: 1 addition & 1 deletion contracts/globalConstraints/TokenCapGC.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol";
import "./GlobalConstraintInterface.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/libs/RealMath.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

/**
* RealMath: fixed-point math library, based on fractional and integer parts.
Expand Down
2 changes: 1 addition & 1 deletion contracts/schemes/Auction4Reputation.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import { RealMath } from "../libs/RealMath.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/schemes/ExternalLocking4Reputation.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "./Locking4Reputation.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/schemes/FixReputationAllocation.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "../controller/ControllerInterface.sol";
import { RealMath } from "../libs/RealMath.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/schemes/Locking4Reputation.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "../controller/ControllerInterface.sol";
import { RealMath } from "../libs/RealMath.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/schemes/LockingEth4Reputation.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "./Locking4Reputation.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/schemes/LockingToken4Reputation.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "./Locking4Reputation.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/ARCDebug.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "@daostack/infra/contracts/VotingMachines/GenesisProtocol.sol";
import "@daostack/infra/contracts/VotingMachines/AbsoluteVote.sol";
Expand Down
6 changes: 3 additions & 3 deletions contracts/test/ARCGenesisProtocolCallbacksMock.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "../VotingMachines/GenesisProtocolCallbacks.sol";
import "../VotingMachines/VotingMachineCallbacks.sol";


contract ARCGenesisProtocolCallbacksMock is GenesisProtocolCallbacks {
contract ARCVotingMachineCallbacksMock is VotingMachineCallbacks {

function propose(bytes32 _proposalId,Avatar _avatar,address _votingMachine) public {
proposalsInfo[_proposalId] = ProposalInfo(
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/ActionMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "../controller/Avatar.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/test/ExternalTokenLockerMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;


contract ExternalTokenLockerMock {
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/GlobalConstraintMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "../globalConstraints/GlobalConstraintInterface.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/test/StandardTokenMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/test/UniversalSchemeMock.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "../universalSchemes/UniversalScheme.sol";
import "../controller/ControllerInterface.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/ERC827/ERC827.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/token/ERC827/ERC827Token.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* solium-disable security/no-low-level-calls */

pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "./ERC827.sol";
import "openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol";
Expand Down
11 changes: 6 additions & 5 deletions contracts/universalSchemes/ContributionReward.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "@daostack/infra/contracts/VotingMachines/IntVoteInterface.sol";
import "@daostack/infra/contracts/VotingMachines/GenesisProtocolCallbacksInterface.sol";
import "@daostack/infra/contracts/VotingMachines/VotingMachineCallbacksInterface.sol";
import "./UniversalScheme.sol";
import "../VotingMachines/GenesisProtocolCallbacks.sol";
import "../VotingMachines/VotingMachineCallbacks.sol";


/**
Expand All @@ -12,7 +12,7 @@ import "../VotingMachines/GenesisProtocolCallbacks.sol";
* him with token, reputation, ether or any combination.
*/

contract ContributionReward is UniversalScheme,GenesisProtocolCallbacks,GenesisProtocolExecuteInterface {
contract ContributionReward is UniversalScheme,VotingMachineCallbacks,ProposalExecuteInterface {
using SafeMath for uint;

event NewContributionProposal(
Expand Down Expand Up @@ -148,7 +148,8 @@ contract ContributionReward is UniversalScheme,GenesisProtocolCallbacks,GenesisP
bytes32 contributionId = controllerParams.intVote.propose(
2,
controllerParams.voteApproveParams,
msg.sender
msg.sender,
_avatar
);

// Check beneficiary is not null:
Expand Down
2 changes: 1 addition & 1 deletion contracts/universalSchemes/DaoCreator.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "./UniversalScheme.sol";
import "../controller/UController.sol";
Expand Down
10 changes: 5 additions & 5 deletions contracts/universalSchemes/GenericScheme.sol
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "@daostack/infra/contracts/VotingMachines/IntVoteInterface.sol";
import "@daostack/infra/contracts/VotingMachines/GenesisProtocolCallbacksInterface.sol";
import "@daostack/infra/contracts/VotingMachines/VotingMachineCallbacksInterface.sol";
import "./UniversalScheme.sol";
import "../VotingMachines/GenesisProtocolCallbacks.sol";
import "../VotingMachines/VotingMachineCallbacks.sol";


/**
* @title GenericScheme.
* @dev A scheme for proposing and executing calls to an arbitrary function
* on a specific contract on behalf of the organization avatar.
*/
contract GenericScheme is UniversalScheme,GenesisProtocolCallbacks,GenesisProtocolExecuteInterface {
contract GenericScheme is UniversalScheme,VotingMachineCallbacks,ProposalExecuteInterface {
event NewCallProposal(
address indexed _avatar,
bytes32 indexed _proposalId,
Expand Down Expand Up @@ -116,7 +116,7 @@ contract GenericScheme is UniversalScheme,GenesisProtocolCallbacks,GenesisProtoc
Parameters memory params = parameters[getParametersFromController(_avatar)];
IntVoteInterface intVote = params.intVote;

bytes32 proposalId = intVote.propose(2, params.voteParams,msg.sender);
bytes32 proposalId = intVote.propose(2, params.voteParams,msg.sender,_avatar);

organizationsProposals[_avatar][proposalId] = CallProposal({
callData: _callData,
Expand Down
12 changes: 6 additions & 6 deletions contracts/universalSchemes/GlobalConstraintRegistrar.sol
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "@daostack/infra/contracts/VotingMachines/IntVoteInterface.sol";
import "@daostack/infra/contracts/VotingMachines/GenesisProtocolCallbacksInterface.sol";
import "@daostack/infra/contracts/VotingMachines/VotingMachineCallbacksInterface.sol";
import "./UniversalScheme.sol";
import "../VotingMachines/GenesisProtocolCallbacks.sol";
import "../VotingMachines/VotingMachineCallbacks.sol";



/**
* @title A scheme to manage global constraint for organizations
* @dev The scheme is used to register or remove new global constraints
*/
contract GlobalConstraintRegistrar is UniversalScheme,GenesisProtocolCallbacks,GenesisProtocolExecuteInterface {
contract GlobalConstraintRegistrar is UniversalScheme,VotingMachineCallbacks,ProposalExecuteInterface {
event NewGlobalConstraintsProposal(
address indexed _avatar,
bytes32 indexed _proposalId,
Expand Down Expand Up @@ -132,7 +132,7 @@ contract GlobalConstraintRegistrar is UniversalScheme,GenesisProtocolCallbacks,G
Parameters memory votingParams = parameters[getParametersFromController(_avatar)];

IntVoteInterface intVote = votingParams.intVote;
bytes32 proposalId = intVote.propose(2, votingParams.voteRegisterParams,msg.sender);
bytes32 proposalId = intVote.propose(2, votingParams.voteRegisterParams,msg.sender,_avatar);

GCProposal memory proposal = GCProposal({
gc: _gc,
Expand Down Expand Up @@ -169,7 +169,7 @@ contract GlobalConstraintRegistrar is UniversalScheme,GenesisProtocolCallbacks,G
require(controller.isGlobalConstraintRegistered(_gc,address(_avatar)));
Parameters memory params = parameters[getParametersFromController(_avatar)];
IntVoteInterface intVote = params.intVote;
bytes32 proposalId = intVote.propose(2, voteToRemoveParams[_avatar][_gc],msg.sender);
bytes32 proposalId = intVote.propose(2, voteToRemoveParams[_avatar][_gc],msg.sender,_avatar);

GCProposal memory proposal = GCProposal({
gc: _gc,
Expand Down
2 changes: 1 addition & 1 deletion contracts/universalSchemes/OrganizationRegister.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "./UniversalScheme.sol";

Expand Down
13 changes: 7 additions & 6 deletions contracts/universalSchemes/SchemeRegistrar.sol
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "@daostack/infra/contracts/VotingMachines/IntVoteInterface.sol";
import "@daostack/infra/contracts/VotingMachines/GenesisProtocolCallbacksInterface.sol";
import "@daostack/infra/contracts/VotingMachines/VotingMachineCallbacksInterface.sol";
import "./UniversalScheme.sol";
import "../VotingMachines/GenesisProtocolCallbacks.sol";
import "../VotingMachines/VotingMachineCallbacks.sol";


/**
* @title A registrar for Schemes for organizations
* @dev The SchemeRegistrar is used for registering and unregistering schemes at organizations
*/

contract SchemeRegistrar is UniversalScheme,GenesisProtocolCallbacks,GenesisProtocolExecuteInterface {
contract SchemeRegistrar is UniversalScheme,VotingMachineCallbacks,ProposalExecuteInterface {
event NewSchemeProposal(
address indexed _avatar,
bytes32 indexed _proposalId,
Expand Down Expand Up @@ -126,7 +126,8 @@ contract SchemeRegistrar is UniversalScheme,GenesisProtocolCallbacks,GenesisProt
bytes32 proposalId = controllerParams.intVote.propose(
2,
controllerParams.voteRegisterParams,
msg.sender
msg.sender,
_avatar
);

SchemeProposal memory proposal = SchemeProposal({
Expand Down Expand Up @@ -168,7 +169,7 @@ contract SchemeRegistrar is UniversalScheme,GenesisProtocolCallbacks,GenesisProt
Parameters memory params = parameters[paramsHash];

IntVoteInterface intVote = params.intVote;
bytes32 proposalId = intVote.propose(2, params.voteRemoveParams,msg.sender);
bytes32 proposalId = intVote.propose(2, params.voteRemoveParams,msg.sender,_avatar);

organizationsProposals[_avatar][proposalId].proposalType = 2;
organizationsProposals[_avatar][proposalId].scheme = _scheme;
Expand Down
2 changes: 1 addition & 1 deletion contracts/universalSchemes/SimpleICO.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "./UniversalScheme.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/universalSchemes/UniversalScheme.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "./UniversalSchemeInterface.sol";
import "../controller/ControllerInterface.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/universalSchemes/UniversalSchemeInterface.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "../controller/Controller.sol";
import "../controller/Avatar.sol";
Expand Down
12 changes: 6 additions & 6 deletions contracts/universalSchemes/UpgradeScheme.sol
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
pragma solidity ^0.4.24;
pragma solidity ^0.4.25;

import "@daostack/infra/contracts/VotingMachines/IntVoteInterface.sol";
import "@daostack/infra/contracts/VotingMachines/GenesisProtocolExecuteInterface.sol";
import "@daostack/infra/contracts/VotingMachines/ProposalExecuteInterface.sol";
import "./UniversalScheme.sol";
import "../VotingMachines/GenesisProtocolCallbacks.sol";
import "../VotingMachines/VotingMachineCallbacks.sol";


/**
* @title A scheme to manage the upgrade of an organization.
* @dev The scheme is used to upgrade the controller of an organization to a new controller.
*/

contract UpgradeScheme is UniversalScheme,GenesisProtocolCallbacks,GenesisProtocolExecuteInterface {
contract UpgradeScheme is UniversalScheme,VotingMachineCallbacks,ProposalExecuteInterface {
event NewUpgradeProposal(
address indexed _avatar,
bytes32 indexed _proposalId,
Expand Down Expand Up @@ -117,7 +117,7 @@ contract UpgradeScheme is UniversalScheme,GenesisProtocolCallbacks,GenesisProtoc
returns(bytes32)
{
Parameters memory params = parameters[getParametersFromController(_avatar)];
bytes32 proposalId = params.intVote.propose(2, params.voteParams,msg.sender);
bytes32 proposalId = params.intVote.propose(2, params.voteParams,msg.sender,_avatar);
UpgradeProposal memory proposal = UpgradeProposal({
proposalType: 1,
upgradeContract: _newController,
Expand Down Expand Up @@ -150,7 +150,7 @@ contract UpgradeScheme is UniversalScheme,GenesisProtocolCallbacks,GenesisProtoc
{
Parameters memory params = parameters[getParametersFromController(_avatar)];
IntVoteInterface intVote = params.intVote;
bytes32 proposalId = intVote.propose(2, params.voteParams,msg.sender);
bytes32 proposalId = intVote.propose(2, params.voteParams,msg.sender,_avatar);
require(organizationsProposals[_avatar][proposalId].proposalType == 0);

UpgradeProposal memory proposal = UpgradeProposal({
Expand Down
Loading

0 comments on commit a347f8e

Please sign in to comment.