Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Futarchy #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12,372 changes: 12,372 additions & 0 deletions apps/finance/package-lock.json

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions future-apps/futarchy/contracts/Futarchy.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
pragma solidity 0.4.23;

import "@aragon/os/contracts/apps/AragonApp.sol";

import "@aragon/os/contracts/common/IForwarder.sol";

contract Futarchy is IForwarder, AragonApp {

function initialize() onlyInit external {
initialized();
}

function newFutarchyMarket(bytes _executionScript, string _metadata) external returns (uint256 marketId) {

}

function isForwarder() public pure returns (bool) {
return true;
}

function forward(bytes _evmScript) public {
require(canForward(msg.sender, _evmScript));
}

function canForward(address _sender, bytes _evmCallScript) public view returns (bool) {
// TODO: Check if sender can forward
return true;
}

function executeDecision(uint256 _marketId) internal {

}
}
25 changes: 25 additions & 0 deletions future-apps/futarchy/contracts/Migrations.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
pragma solidity 0.4.23;


contract Migrations {
address public owner;
uint public last_completed_migration;

modifier restricted() {
if (msg.sender == owner)
_;
}

constructor() public {
owner = msg.sender;
}

function setCompleted(uint completed) public restricted {
last_completed_migration = completed;
}

function upgrade(address new_address) public restricted {
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
}
5 changes: 5 additions & 0 deletions future-apps/futarchy/migrations/1_initial_migration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Migrations = artifacts.require('Migrations')

module.exports = function (deployer) {
deployer.deploy(Migrations)
}
8 changes: 8 additions & 0 deletions future-apps/futarchy/migrations/2_deploy_futarchy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var Futarchy = artifacts.require("./Futarchy.sol")
var Math = artifacts.require("@gnosis.pm/gnosis-core-contracts/Math.sol")

module.exports = function(deployer) {
deployer.deploy(Math)
deployer.link(Math, Futarchy)
deployer.deploy(Futarchy)
};
Loading