From 2882094c759a4ed246df700c2e6b3371c647804e Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Sat, 13 Jun 2020 19:15:00 +0200 Subject: [PATCH 01/32] Correct contact associations So far our contract discovery was wrong. https://spectrum.chat/aragon/aragonos/how-do-i-get-the-appid-namehash-of-an-app-in-open-aragonpm-eth~50dd2c67-63a2-49cf-bc64-aa033e33f48d All dependent contract connections that are needed must be passed in and can not be discovered from the DAO/Kernel/whatever. So far I have no idea how we upgrade to these new contracts. --- apps/contribution/contracts/Contribution.sol | 39 ++++++------------- apps/contributor/contracts/Contributor.sol | 27 +++++-------- apps/proposal/contracts/Proposal.sol | 22 ++++------- .../reimbursement/contracts/Reimbursement.sol | 4 +- apps/token/contracts/Token.sol | 7 +--- contracts/KreditsKit.sol | 38 +++++++++--------- contracts/misc/APMNamehashOpen.sol | 13 ------- lib/abis/Contribution.json | 2 +- lib/abis/Contributor.json | 2 +- lib/abis/Proposal.json | 2 +- lib/abis/Reimbursement.json | 2 +- lib/abis/Token.json | 2 +- scripts/deploy-kit.js | 2 +- 13 files changed, 56 insertions(+), 106 deletions(-) delete mode 100644 contracts/misc/APMNamehashOpen.sol diff --git a/apps/contribution/contracts/Contribution.sol b/apps/contribution/contracts/Contribution.sol index 465fa5f..dd02a68 100644 --- a/apps/contribution/contracts/Contribution.sol +++ b/apps/contribution/contracts/Contribution.sol @@ -18,11 +18,8 @@ contract Contribution is AragonApp { bytes32 public constant ADD_CONTRIBUTION_ROLE = keccak256("ADD_CONTRIBUTION_ROLE"); bytes32 public constant VETO_CONTRIBUTION_ROLE = keccak256("VETO_CONTRIBUTION_ROLE"); - bytes32 public constant KERNEL_APP_ADDR_NAMESPACE = 0xd6f028ca0e8edb4a8c9757ca4fdccab25fa1e0317da1188108f7d2dee14902fb; - - // ensure alphabetic order - enum Apps { Contribution, Contributor, Proposal, Reimbursement, Token } - bytes32[5] public appIds; + IToken public kreditsToken; + ContributorInterface public kreditsContributor; struct ContributionData { uint32 contributorId; @@ -54,27 +51,14 @@ contract Contribution is AragonApp { event ContributionClaimed(uint32 id, uint32 indexed contributorId, uint32 amount); event ContributionVetoed(uint32 id, address vetoedByAccount); - function initialize(bytes32[5] _appIds) public onlyInit { - appIds = _appIds; + function initialize(address _token, address _contributor) public onlyInit { + kreditsToken = IToken(_token); + kreditsContributor = ContributorInterface(_contributor); + blocksToWait = 40320; // 7 days; 15 seconds block time initialized(); } - function getContract(uint8 appId) public view returns (address) { - IKernel k = IKernel(kernel()); - return k.getApp(KERNEL_APP_ADDR_NAMESPACE, appIds[appId]); - } - - function getContributorIdByAddress(address contributorAccount) public view returns (uint32) { - address contributor = getContract(uint8(Apps.Contributor)); - return ContributorInterface(contributor).getContributorIdByAddress(contributorAccount); - } - - function getContributorAddressById(uint32 contributorId) public view returns (address) { - address contributor = getContract(uint8(Apps.Contributor)); - return ContributorInterface(contributor).getContributorAddressById(contributorId); - } - // // Token standard functions (ERC 721) // @@ -90,18 +74,18 @@ contract Contribution is AragonApp { // Balance is amount of ERC271 tokens, not amount of kredits function balanceOf(address owner) public view returns (uint256) { require(owner != address(0)); - uint32 contributorId = getContributorIdByAddress(owner); + uint32 contributorId = kreditsContributor.getContributorIdByAddress(owner); return ownedContributions[contributorId].length; } function ownerOf(uint32 contributionId) public view returns (address) { require(exists(contributionId)); uint32 contributorId = contributions[contributionId].contributorId; - return getContributorAddressById(contributorId); + return kreditsContributor.getContributorAddressById(contributorId); } function tokenOfOwnerByIndex(address owner, uint32 index) public view returns (uint32) { - uint32 contributorId = getContributorIdByAddress(owner); + uint32 contributorId = kreditsContributor.getContributorIdByAddress(owner); return ownedContributions[contributorId][index]; } @@ -193,10 +177,9 @@ contract Contribution is AragonApp { require(block.number >= c.confirmedAtBlock, 'NOT_CLAIMABLE'); c.claimed = true; - address token = getContract(uint8(Apps.Token)); - address contributorAccount = getContributorAddressById(c.contributorId); + address contributorAccount = kreditsContributor.getContributorAddressById(c.contributorId); uint256 amount = uint256(c.amount); - IToken(token).mintFor(contributorAccount, amount, contributionId); + kreditsToken.mintFor(contributorAccount, amount, contributionId); emit ContributionClaimed(contributionId, c.contributorId, c.amount); } diff --git a/apps/contributor/contracts/Contributor.sol b/apps/contributor/contracts/Contributor.sol index eb9d785..131a997 100644 --- a/apps/contributor/contracts/Contributor.sol +++ b/apps/contributor/contracts/Contributor.sol @@ -12,9 +12,11 @@ interface IContributionBalance { } contract Contributor is AragonApp { - bytes32 public constant KERNEL_APP_ADDR_NAMESPACE = 0xd6f028ca0e8edb4a8c9757ca4fdccab25fa1e0317da1188108f7d2dee14902fb; bytes32 public constant MANAGE_CONTRIBUTORS_ROLE = keccak256("MANAGE_CONTRIBUTORS_ROLE"); + ITokenBalance public kreditsToken; + IContributionBalance public kreditsContribution; + struct Contributor { address account; bytes32 hashDigest; @@ -27,25 +29,16 @@ contract Contributor is AragonApp { mapping (uint32 => Contributor) public contributors; uint32 public contributorsCount; - // ensure alphabetic order - enum Apps { Contribution, Contributor, Proposal, Reimbursement, Token } - bytes32[5] public appIds; - event ContributorProfileUpdated(uint32 id, bytes32 oldHashDigest, bytes32 newHashDigest); // what should be logged event ContributorAccountUpdated(uint32 id, address oldAccount, address newAccount); event ContributorAdded(uint32 id, address account); - function initialize(address root, bytes32[5] _appIds) public onlyInit { - appIds = _appIds; - + function initialize(address _contribution, address _token) public onlyInit { + kreditsToken = ITokenBalance(_token); + kreditsContribution = IContributionBalance(_contribution); initialized(); } - function getContract(uint8 appId) public view returns (address) { - IKernel k = IKernel(kernel()); - return k.getApp(KERNEL_APP_ADDR_NAMESPACE, appIds[appId]); - } - function coreContributorsCount() public view returns (uint32) { uint32 count = 0; for (uint32 i = 1; i <= contributorsCount; i++) { @@ -132,11 +125,9 @@ contract Contributor is AragonApp { hashFunction = c.hashFunction; hashSize = c.hashSize; isCore = isCoreTeam(id); - address token = getContract(uint8(Apps.Token)); - balance = ITokenBalance(token).balanceOf(c.account); - address contribution = getContract(uint8(Apps.Contribution)); - totalKreditsEarned = IContributionBalance(contribution).totalKreditsEarnedByContributor(_id, true); - contributionsCount = IContributionBalance(contribution).balanceOf(c.account); + balance = kreditsToken.balanceOf(c.account); + totalKreditsEarned = kreditsContribution.totalKreditsEarnedByContributor(_id, true); + contributionsCount = kreditsContribution.balanceOf(c.account); exists = c.exists; } diff --git a/apps/proposal/contracts/Proposal.sol b/apps/proposal/contracts/Proposal.sol index 8f63f70..3eb0a02 100644 --- a/apps/proposal/contracts/Proposal.sol +++ b/apps/proposal/contracts/Proposal.sol @@ -18,10 +18,8 @@ contract Proposal is AragonApp { bytes32 public constant ADD_PROPOSAL_ROLE = keccak256("ADD_PROPOSAL_ROLE"); bytes32 public constant VOTE_PROPOSAL_ROLE = keccak256("VOTE_PROPOSAL_ROLE"); - bytes32 public constant KERNEL_APP_ADDR_NAMESPACE = 0xd6f028ca0e8edb4a8c9757ca4fdccab25fa1e0317da1188108f7d2dee14902fb; - // ensure alphabetic order - enum Apps { Contribution, Contributor, Proposal, Reimbursement, Token } - bytes32[5] public appIds; + IContributor public kreditsContributor; + IContribution public kreditsContribution; struct Proposal { address creatorAccount; @@ -46,18 +44,14 @@ contract Proposal is AragonApp { event ProposalVoted(uint32 id, uint32 voterId, uint16 totalVotes); event ProposalExecuted(uint32 id, uint32 contributorId, uint32 amount); - function initialize(bytes32[5] _appIds) public onlyInit { - appIds = _appIds; + function initialize(address _contributor, address _contribution) public onlyInit { + kreditsContributor = IContributor(_contributor); + kreditsContribution = IContribution(_contribution); initialized(); } - function getContract(uint8 appId) public view returns (address) { - IKernel k = IKernel(kernel()); - return k.getApp(KERNEL_APP_ADDR_NAMESPACE, appIds[appId]); - } - function addProposal(uint32 contributorId, uint32 amount, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize) public isInitialized auth(ADD_PROPOSAL_ROLE) { - require(IContributor(getContract(uint8(Apps.Contributor))).exists(contributorId), 'CONTRIBUTOR_NOT_FOUND'); + require(kreditsContributor.exists(contributorId), 'CONTRIBUTOR_NOT_FOUND'); uint32 proposalId = proposalsCount + 1; uint16 _votesNeeded = 1; //contributorsContract().coreContributorsCount() / 100 * 75; @@ -99,7 +93,7 @@ contract Proposal is AragonApp { function vote(uint32 proposalId) public isInitialized auth(VOTE_PROPOSAL_ROLE) { Proposal storage p = proposals[proposalId]; require(!p.executed, 'ALREADY_EXECUTED'); - uint32 voterId = IContributor(getContract(uint8(Apps.Contributor))).getContributorIdByAddress(msg.sender); + uint32 voterId = kreditsContributor.getContributorIdByAddress(msg.sender); require(p.votes[voterId] != true, 'ALREADY_VOTED'); p.voterIds.push(voterId); p.votes[voterId] = true; @@ -123,7 +117,7 @@ contract Proposal is AragonApp { require(p.votesCount >= p.votesNeeded, 'MISSING_VOTES'); p.executed = true; - IContribution(getContract(uint8(Apps.Contribution))).add(p.amount, p.contributorId, p.hashDigest, p.hashFunction, p.hashSize); + kreditsContribution.add(p.amount, p.contributorId, p.hashDigest, p.hashFunction, p.hashSize); emit ProposalExecuted(proposalId, p.contributorId, p.amount); } diff --git a/apps/reimbursement/contracts/Reimbursement.sol b/apps/reimbursement/contracts/Reimbursement.sol index f60254a..39248cb 100644 --- a/apps/reimbursement/contracts/Reimbursement.sol +++ b/apps/reimbursement/contracts/Reimbursement.sol @@ -28,9 +28,7 @@ contract Reimbursement is AragonApp { event ReimbursementAdded(uint32 id, address indexed addedByAccount, uint256 amount); event ReimbursementVetoed(uint32 id, address vetoedByAccount); - // TODO: remove _appIds when those are removed from the kreditskit - // using the appids to find other apps is wrong according to aragon - function initialize(bytes32[5] _appIds) public onlyInit { + function initialize() public onlyInit { blocksToWait = 40320; // 7 days; 15 seconds block time initialized(); } diff --git a/apps/token/contracts/Token.sol b/apps/token/contracts/Token.sol index 7fbc20f..fdbae6c 100644 --- a/apps/token/contracts/Token.sol +++ b/apps/token/contracts/Token.sol @@ -6,14 +6,9 @@ import "./ERC20Token.sol"; contract Token is ERC20Token, AragonApp { bytes32 public constant MINT_TOKEN_ROLE = keccak256("MINT_TOKEN_ROLE"); - // ensure alphabetic order - enum Apps { Contribution, Contributor, Proposal, Reimbursement, Token } - bytes32[5] public appIds; - event LogMint(address indexed recipient, uint256 amount, uint32 contributionId); - function initialize(bytes32[5] _appIds) public onlyInit { - appIds = _appIds; + function initialize() public onlyInit { name = 'Kredits'; symbol = '₭S'; decimals = 18; diff --git a/contracts/KreditsKit.sol b/contracts/KreditsKit.sol index d90c3c3..2bfa872 100644 --- a/contracts/KreditsKit.sol +++ b/contracts/KreditsKit.sol @@ -12,17 +12,19 @@ import "../apps/token/contracts/Token.sol"; import "../apps/proposal/contracts/Proposal.sol"; import "../apps/reimbursement/contracts/Reimbursement.sol"; -contract KreditsKit is KitBase { +contract KreditsKit is KitBase { - // ensure alphabetic order - enum Apps { Contribution, Contributor, Proposal, Reimbursement, Token } - bytes32[5] public appIds; + bytes32 constant internal CONTRIBUTION_APP_ID = 0x09f5274cba299b46c5be722ef672d10eef7a2ef980b612aef529d74fb9da7643; + bytes32 constant internal CONTRIBUTOR_APP_ID = 0x8e50972b062e83b48dbb2a68d8a058f2a07227ca183c144dc974e6da3186d7e9; + bytes32 constant internal PROPOSAL_APP_ID= 0xb48bc8b4e539823f3be98d67f4130c07b5d29cc998993debcdea15c6faf4cf8a; + bytes32 constant internal REIMBURSEMENT_APP_ID = 0x1103c160cab5c23100981f67c020a021d46a894a4f262b6e1180b335a639d3d2; + bytes32 constant internal TOKEN_APP_ID = 0x82c0e483537d703bb6f0fc799d2cc60d8f62edcb0f6d26d5571a92be8485b112; event DeployInstance(address dao); event InstalledApp(address dao, address appProxy, bytes32 appId); - constructor (DAOFactory _fac, ENS _ens, bytes32[5] _appIds) public KitBase(_fac, _ens) { - appIds = _appIds; + constructor (DAOFactory _fac, ENS _ens) public KitBase(_fac, _ens) { + // appIds = _appIds; } function newInstance() public returns (Kernel dao) { @@ -32,25 +34,26 @@ contract KreditsKit is KitBase { acl.createPermission(this, dao, dao.APP_MANAGER_ROLE(), this); - Contributor contributor = Contributor(_installApp(dao, appIds[uint8(Apps.Contributor)])); - contributor.initialize(root, appIds); + Contribution contribution = Contribution(_installApp(dao, CONTRIBUTION_APP_ID)); + Contributor contributor = Contributor(_installApp(dao, CONTRIBUTOR_APP_ID)); + Proposal proposal = Proposal(_installApp(dao, PROPOSAL_APP_ID)); + Reimbursement reimbursement = Reimbursement(_installApp(dao,REIMBURSEMENT_APP_ID)); + Token token = Token(_installApp(dao, TOKEN_APP_ID)); + + token.initialize(); + contributor.initialize(contribution, token); + acl.createPermission(root, contributor, contributor.MANAGE_CONTRIBUTORS_ROLE(), this); - Token token = Token(_installApp(dao, appIds[uint8(Apps.Token)])); - token.initialize(appIds); - - Contribution contribution = Contribution(_installApp(dao, appIds[uint8(Apps.Contribution)])); - contribution.initialize(appIds); + contribution.initialize(token, contributor); acl.createPermission(root, contribution, contribution.ADD_CONTRIBUTION_ROLE(), this); acl.createPermission(root, contribution, contribution.VETO_CONTRIBUTION_ROLE(), this); acl.grantPermission(proposal, contribution, contribution.ADD_CONTRIBUTION_ROLE()); - Proposal proposal = Proposal(_installApp(dao, appIds[uint8(Apps.Proposal)])); - proposal.initialize(appIds); + proposal.initialize(contributor, contribution); - Reimbursement reimbursement = Reimbursement(_installApp(dao, appIds[uint8(Apps.Reimbursement)])); - reimbursement.initialize(appIds); + reimbursement.initialize(); acl.createPermission(root, reimbursement, reimbursement.ADD_REIMBURSEMENT_ROLE(), this); acl.createPermission(root, reimbursement, reimbursement.VETO_REIMBURSEMENT_ROLE(), this); @@ -80,7 +83,6 @@ contract KreditsKit is KitBase { acl.grantPermission(contribution, token, token.MINT_TOKEN_ROLE()); acl.setPermissionManager(root, token, token.MINT_TOKEN_ROLE()); - cleanupDAOPermissions(dao, acl, root); emit DeployInstance(dao); diff --git a/contracts/misc/APMNamehashOpen.sol b/contracts/misc/APMNamehashOpen.sol deleted file mode 100644 index 20a375a..0000000 --- a/contracts/misc/APMNamehashOpen.sol +++ /dev/null @@ -1,13 +0,0 @@ -pragma solidity 0.4.24; - -import "@aragon/os/contracts/apm/APMNamehash.sol"; - - -contract APMNamehashOpen is APMNamehash { - bytes32 public constant OPEN_TITLE = keccak256("open"); - bytes32 public constant OPEN_APM_NODE = keccak256(abi.encodePacked(APM_NODE, OPEN_TITLE)); - - function apmNamehashOpen(string name) internal pure returns (bytes32) { - return keccak256(abi.encodePacked(OPEN_APM_NODE, keccak256(name))); - } -} diff --git a/lib/abis/Contribution.json b/lib/abis/Contribution.json index 5548e80..2201fe1 100644 --- a/lib/abis/Contribution.json +++ b/lib/abis/Contribution.json @@ -1 +1 @@ -[{"constant":true,"inputs":[],"name":"hasInitialized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ADD_CONTRIBUTION_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getEVMScriptExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRecoveryVault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"contributionsCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"}],"name":"allowRecoverability","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"KERNEL_APP_ADDR_NAMESPACE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"transferToVault","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_sender","type":"address"},{"name":"_role","type":"bytes32"},{"name":"_params","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getEVMScriptRegistry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"contributionOwner","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"contributions","outputs":[{"name":"contributorId","type":"uint32"},{"name":"amount","type":"uint32"},{"name":"claimed","type":"bool"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"tokenMetadataURL","type":"string"},{"name":"confirmedAtBlock","type":"uint256"},{"name":"vetoed","type":"bool"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"},{"name":"","type":"uint256"}],"name":"ownedContributions","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"blocksToWait","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPetrified","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"appIds","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"VETO_CONTRIBUTION_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":true,"name":"contributorId","type":"uint32"},{"indexed":false,"name":"amount","type":"uint32"}],"name":"ContributionAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":true,"name":"contributorId","type":"uint32"},{"indexed":false,"name":"amount","type":"uint32"}],"name":"ContributionClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"vetoedByAccount","type":"address"}],"name":"ContributionVetoed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"executor","type":"address"},{"indexed":false,"name":"script","type":"bytes"},{"indexed":false,"name":"input","type":"bytes"},{"indexed":false,"name":"returnData","type":"bytes"}],"name":"ScriptResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"vault","type":"address"},{"indexed":true,"name":"token","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"RecoverToVault","type":"event"},{"constant":false,"inputs":[{"name":"_appIds","type":"bytes32[5]"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"appId","type":"uint8"}],"name":"getContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"contributorAccount","type":"address"}],"name":"getContributorIdByAddress","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"contributorId","type":"uint32"}],"name":"getContributorAddressById","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"ownerOf","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"index","type":"uint32"}],"name":"tokenOfOwnerByIndex","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"tokenMetadata","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"confirmedOnly","type":"bool"}],"name":"totalKreditsEarned","outputs":[{"name":"amount","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"contributorId","type":"uint32"},{"name":"confirmedOnly","type":"bool"}],"name":"totalKreditsEarnedByContributor","outputs":[{"name":"amount","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"getContribution","outputs":[{"name":"id","type":"uint32"},{"name":"contributorId","type":"uint32"},{"name":"amount","type":"uint32"},{"name":"claimed","type":"bool"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"confirmedAtBlock","type":"uint256"},{"name":"exists","type":"bool"},{"name":"vetoed","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint32"},{"name":"contributorId","type":"uint32"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"}],"name":"add","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"veto","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"claim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"exists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"}] \ No newline at end of file +[{"constant":true,"inputs":[],"name":"hasInitialized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kreditsContributor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ADD_CONTRIBUTION_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getEVMScriptExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRecoveryVault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"contributionsCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"}],"name":"allowRecoverability","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"transferToVault","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_sender","type":"address"},{"name":"_role","type":"bytes32"},{"name":"_params","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getEVMScriptRegistry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"contributionOwner","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kreditsToken","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"contributions","outputs":[{"name":"contributorId","type":"uint32"},{"name":"amount","type":"uint32"},{"name":"claimed","type":"bool"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"tokenMetadataURL","type":"string"},{"name":"confirmedAtBlock","type":"uint256"},{"name":"vetoed","type":"bool"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"},{"name":"","type":"uint256"}],"name":"ownedContributions","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"blocksToWait","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPetrified","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"VETO_CONTRIBUTION_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":true,"name":"contributorId","type":"uint32"},{"indexed":false,"name":"amount","type":"uint32"}],"name":"ContributionAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":true,"name":"contributorId","type":"uint32"},{"indexed":false,"name":"amount","type":"uint32"}],"name":"ContributionClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"vetoedByAccount","type":"address"}],"name":"ContributionVetoed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"executor","type":"address"},{"indexed":false,"name":"script","type":"bytes"},{"indexed":false,"name":"input","type":"bytes"},{"indexed":false,"name":"returnData","type":"bytes"}],"name":"ScriptResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"vault","type":"address"},{"indexed":true,"name":"token","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"RecoverToVault","type":"event"},{"constant":false,"inputs":[{"name":"_token","type":"address"},{"name":"_contributor","type":"address"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"ownerOf","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"index","type":"uint32"}],"name":"tokenOfOwnerByIndex","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"tokenMetadata","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"confirmedOnly","type":"bool"}],"name":"totalKreditsEarned","outputs":[{"name":"amount","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"contributorId","type":"uint32"},{"name":"confirmedOnly","type":"bool"}],"name":"totalKreditsEarnedByContributor","outputs":[{"name":"amount","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"getContribution","outputs":[{"name":"id","type":"uint32"},{"name":"contributorId","type":"uint32"},{"name":"amount","type":"uint32"},{"name":"claimed","type":"bool"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"confirmedAtBlock","type":"uint256"},{"name":"exists","type":"bool"},{"name":"vetoed","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint32"},{"name":"contributorId","type":"uint32"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"}],"name":"add","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"veto","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"claim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"exists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"}] \ No newline at end of file diff --git a/lib/abis/Contributor.json b/lib/abis/Contributor.json index 5b75955..45c241a 100644 --- a/lib/abis/Contributor.json +++ b/lib/abis/Contributor.json @@ -1 +1 @@ -[{"constant":true,"inputs":[],"name":"hasInitialized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getEVMScriptExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRecoveryVault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"contributorsCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"}],"name":"allowRecoverability","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"contributorIds","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"KERNEL_APP_ADDR_NAMESPACE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"transferToVault","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"MANAGE_CONTRIBUTORS_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"contributors","outputs":[{"name":"account","type":"address"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getEVMScriptRegistry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPetrified","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"appIds","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"oldHashDigest","type":"bytes32"},{"indexed":false,"name":"newHashDigest","type":"bytes32"}],"name":"ContributorProfileUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"oldAccount","type":"address"},{"indexed":false,"name":"newAccount","type":"address"}],"name":"ContributorAccountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"account","type":"address"}],"name":"ContributorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"executor","type":"address"},{"indexed":false,"name":"script","type":"bytes"},{"indexed":false,"name":"input","type":"bytes"},{"indexed":false,"name":"returnData","type":"bytes"}],"name":"ScriptResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"vault","type":"address"},{"indexed":true,"name":"token","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"RecoverToVault","type":"event"},{"constant":false,"inputs":[{"name":"root","type":"address"},{"name":"_appIds","type":"bytes32[5]"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"appId","type":"uint8"}],"name":"getContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"coreContributorsCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint32"},{"name":"oldAccount","type":"address"},{"name":"newAccount","type":"address"}],"name":"updateContributorAccount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint32"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"}],"name":"updateContributorProfileHash","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"}],"name":"addContributor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint32"}],"name":"isCoreTeam","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint32"}],"name":"exists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"addressIsCore","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"addressExists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"getContributorIdByAddress","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint32"}],"name":"getContributorAddressById","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint32"}],"name":"getContributorById","outputs":[{"name":"id","type":"uint32"},{"name":"account","type":"address"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"isCore","type":"bool"},{"name":"balance","type":"uint256"},{"name":"totalKreditsEarned","type":"uint32"},{"name":"contributionsCount","type":"uint256"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_sender","type":"address"},{"name":"_role","type":"bytes32"},{"name":"_params","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_who","type":"address"},{"name":"_where","type":"address"},{"name":"_what","type":"bytes32"},{"name":"_how","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}] \ No newline at end of file +[{"constant":true,"inputs":[],"name":"hasInitialized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getEVMScriptExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRecoveryVault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"contributorsCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"}],"name":"allowRecoverability","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"contributorIds","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"KERNEL_APP_ADDR_NAMESPACE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"transferToVault","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"MANAGE_CONTRIBUTORS_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"contributors","outputs":[{"name":"account","type":"address"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getEVMScriptRegistry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kreditsToken","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPetrified","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kreditsContribution","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"oldHashDigest","type":"bytes32"},{"indexed":false,"name":"newHashDigest","type":"bytes32"}],"name":"ContributorProfileUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"oldAccount","type":"address"},{"indexed":false,"name":"newAccount","type":"address"}],"name":"ContributorAccountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"account","type":"address"}],"name":"ContributorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"executor","type":"address"},{"indexed":false,"name":"script","type":"bytes"},{"indexed":false,"name":"input","type":"bytes"},{"indexed":false,"name":"returnData","type":"bytes"}],"name":"ScriptResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"vault","type":"address"},{"indexed":true,"name":"token","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"RecoverToVault","type":"event"},{"constant":false,"inputs":[{"name":"_contribution","type":"address"},{"name":"_token","type":"address"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"coreContributorsCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint32"},{"name":"oldAccount","type":"address"},{"name":"newAccount","type":"address"}],"name":"updateContributorAccount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint32"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"}],"name":"updateContributorProfileHash","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"}],"name":"addContributor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint32"}],"name":"isCoreTeam","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint32"}],"name":"exists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"addressIsCore","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"addressExists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"getContributorIdByAddress","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint32"}],"name":"getContributorAddressById","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint32"}],"name":"getContributorById","outputs":[{"name":"id","type":"uint32"},{"name":"account","type":"address"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"isCore","type":"bool"},{"name":"balance","type":"uint256"},{"name":"totalKreditsEarned","type":"uint32"},{"name":"contributionsCount","type":"uint256"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_sender","type":"address"},{"name":"_role","type":"bytes32"},{"name":"_params","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_who","type":"address"},{"name":"_where","type":"address"},{"name":"_what","type":"bytes32"},{"name":"_how","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}] \ No newline at end of file diff --git a/lib/abis/Proposal.json b/lib/abis/Proposal.json index d64fa77..a8a2f4c 100644 --- a/lib/abis/Proposal.json +++ b/lib/abis/Proposal.json @@ -1 +1 @@ -[{"constant":true,"inputs":[],"name":"hasInitialized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"proposalsCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getEVMScriptExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"proposals","outputs":[{"name":"creatorAccount","type":"address"},{"name":"contributorId","type":"uint32"},{"name":"votesCount","type":"uint16"},{"name":"votesNeeded","type":"uint16"},{"name":"amount","type":"uint32"},{"name":"executed","type":"bool"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRecoveryVault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"VOTE_PROPOSAL_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"}],"name":"allowRecoverability","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"KERNEL_APP_ADDR_NAMESPACE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"transferToVault","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_sender","type":"address"},{"name":"_role","type":"bytes32"},{"name":"_params","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getEVMScriptRegistry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPetrified","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"appIds","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ADD_PROPOSAL_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"creatorAccount","type":"address"},{"indexed":false,"name":"contributorId","type":"uint32"},{"indexed":false,"name":"amount","type":"uint32"}],"name":"ProposalCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"voterId","type":"uint32"},{"indexed":false,"name":"totalVotes","type":"uint16"}],"name":"ProposalVoted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"contributorId","type":"uint32"},{"indexed":false,"name":"amount","type":"uint32"}],"name":"ProposalExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"executor","type":"address"},{"indexed":false,"name":"script","type":"bytes"},{"indexed":false,"name":"input","type":"bytes"},{"indexed":false,"name":"returnData","type":"bytes"}],"name":"ScriptResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"vault","type":"address"},{"indexed":true,"name":"token","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"RecoverToVault","type":"event"},{"constant":false,"inputs":[{"name":"_appIds","type":"bytes32[5]"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"appId","type":"uint8"}],"name":"getContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"contributorId","type":"uint32"},{"name":"amount","type":"uint32"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"}],"name":"addProposal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"proposalId","type":"uint32"}],"name":"getProposal","outputs":[{"name":"id","type":"uint32"},{"name":"creatorAccount","type":"address"},{"name":"contributorId","type":"uint32"},{"name":"votesCount","type":"uint16"},{"name":"votesNeeded","type":"uint16"},{"name":"amount","type":"uint32"},{"name":"executed","type":"bool"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"voterIds","type":"uint32[]"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"proposalId","type":"uint32"}],"name":"vote","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_proposalIds","type":"uint32[]"}],"name":"batchVote","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}] \ No newline at end of file +[{"constant":true,"inputs":[],"name":"hasInitialized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"proposalsCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kreditsContributor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getEVMScriptExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"proposals","outputs":[{"name":"creatorAccount","type":"address"},{"name":"contributorId","type":"uint32"},{"name":"votesCount","type":"uint16"},{"name":"votesNeeded","type":"uint16"},{"name":"amount","type":"uint32"},{"name":"executed","type":"bool"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRecoveryVault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"VOTE_PROPOSAL_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"}],"name":"allowRecoverability","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"transferToVault","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_sender","type":"address"},{"name":"_role","type":"bytes32"},{"name":"_params","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getEVMScriptRegistry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPetrified","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kreditsContribution","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ADD_PROPOSAL_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"creatorAccount","type":"address"},{"indexed":false,"name":"contributorId","type":"uint32"},{"indexed":false,"name":"amount","type":"uint32"}],"name":"ProposalCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"voterId","type":"uint32"},{"indexed":false,"name":"totalVotes","type":"uint16"}],"name":"ProposalVoted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"contributorId","type":"uint32"},{"indexed":false,"name":"amount","type":"uint32"}],"name":"ProposalExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"executor","type":"address"},{"indexed":false,"name":"script","type":"bytes"},{"indexed":false,"name":"input","type":"bytes"},{"indexed":false,"name":"returnData","type":"bytes"}],"name":"ScriptResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"vault","type":"address"},{"indexed":true,"name":"token","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"RecoverToVault","type":"event"},{"constant":false,"inputs":[{"name":"_contributor","type":"address"},{"name":"_contribution","type":"address"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"contributorId","type":"uint32"},{"name":"amount","type":"uint32"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"}],"name":"addProposal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"proposalId","type":"uint32"}],"name":"getProposal","outputs":[{"name":"id","type":"uint32"},{"name":"creatorAccount","type":"address"},{"name":"contributorId","type":"uint32"},{"name":"votesCount","type":"uint16"},{"name":"votesNeeded","type":"uint16"},{"name":"amount","type":"uint32"},{"name":"executed","type":"bool"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"voterIds","type":"uint32[]"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"proposalId","type":"uint32"}],"name":"vote","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_proposalIds","type":"uint32[]"}],"name":"batchVote","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}] \ No newline at end of file diff --git a/lib/abis/Reimbursement.json b/lib/abis/Reimbursement.json index 106dcd5..fd2a9cb 100644 --- a/lib/abis/Reimbursement.json +++ b/lib/abis/Reimbursement.json @@ -1 +1 @@ -[{"constant":true,"inputs":[],"name":"hasInitialized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getEVMScriptExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRecoveryVault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"reimbursementsCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"VETO_REIMBURSEMENT_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"}],"name":"allowRecoverability","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ADD_REIMBURSEMENT_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"transferToVault","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_sender","type":"address"},{"name":"_role","type":"bytes32"},{"name":"_params","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getEVMScriptRegistry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"reimbursements","outputs":[{"name":"requestedBy","type":"address"},{"name":"contributorId","type":"uint32"},{"name":"amount","type":"uint256"},{"name":"token","type":"address"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"confirmedAtBlock","type":"uint256"},{"name":"vetoed","type":"bool"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"blocksToWait","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPetrified","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":true,"name":"addedByAccount","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"ReimbursementAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"vetoedByAccount","type":"address"}],"name":"ReimbursementVetoed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"executor","type":"address"},{"indexed":false,"name":"script","type":"bytes"},{"indexed":false,"name":"input","type":"bytes"},{"indexed":false,"name":"returnData","type":"bytes"}],"name":"ScriptResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"vault","type":"address"},{"indexed":true,"name":"token","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"RecoverToVault","type":"event"},{"constant":false,"inputs":[{"name":"_appIds","type":"bytes32[5]"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"confirmedOnly","type":"bool"}],"name":"totalAmount","outputs":[{"name":"amount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"reimbursementId","type":"uint32"}],"name":"get","outputs":[{"name":"id","type":"uint32"},{"name":"requestedBy","type":"address"},{"name":"contributorId","type":"uint32"},{"name":"amount","type":"uint256"},{"name":"token","type":"address"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"confirmedAtBlock","type":"uint256"},{"name":"exists","type":"bool"},{"name":"vetoed","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"},{"name":"token","type":"address"},{"name":"contributorId","type":"uint32"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"}],"name":"add","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"reimbursementId","type":"uint32"}],"name":"veto","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"reimbursementId","type":"uint32"}],"name":"exists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"}] \ No newline at end of file +[{"constant":true,"inputs":[],"name":"hasInitialized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getEVMScriptExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRecoveryVault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"reimbursementsCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"VETO_REIMBURSEMENT_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"}],"name":"allowRecoverability","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ADD_REIMBURSEMENT_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"transferToVault","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_sender","type":"address"},{"name":"_role","type":"bytes32"},{"name":"_params","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getEVMScriptRegistry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"reimbursements","outputs":[{"name":"requestedBy","type":"address"},{"name":"contributorId","type":"uint32"},{"name":"amount","type":"uint256"},{"name":"token","type":"address"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"confirmedAtBlock","type":"uint256"},{"name":"vetoed","type":"bool"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"blocksToWait","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPetrified","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":true,"name":"addedByAccount","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"ReimbursementAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"vetoedByAccount","type":"address"}],"name":"ReimbursementVetoed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"executor","type":"address"},{"indexed":false,"name":"script","type":"bytes"},{"indexed":false,"name":"input","type":"bytes"},{"indexed":false,"name":"returnData","type":"bytes"}],"name":"ScriptResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"vault","type":"address"},{"indexed":true,"name":"token","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"RecoverToVault","type":"event"},{"constant":false,"inputs":[],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"confirmedOnly","type":"bool"}],"name":"totalAmount","outputs":[{"name":"amount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"reimbursementId","type":"uint32"}],"name":"get","outputs":[{"name":"id","type":"uint32"},{"name":"requestedBy","type":"address"},{"name":"contributorId","type":"uint32"},{"name":"amount","type":"uint256"},{"name":"token","type":"address"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"confirmedAtBlock","type":"uint256"},{"name":"exists","type":"bool"},{"name":"vetoed","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"},{"name":"token","type":"address"},{"name":"contributorId","type":"uint32"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"}],"name":"add","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"reimbursementId","type":"uint32"}],"name":"veto","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"reimbursementId","type":"uint32"}],"name":"exists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"}] \ No newline at end of file diff --git a/lib/abis/Token.json b/lib/abis/Token.json index 59e1b53..57e2ebf 100644 --- a/lib/abis/Token.json +++ b/lib/abis/Token.json @@ -1 +1 @@ -[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"hasInitialized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getEVMScriptExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRecoveryVault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"_totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"_balances","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"}],"name":"allowRecoverability","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MINT_TOKEN_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"transferToVault","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_sender","type":"address"},{"name":"_role","type":"bytes32"},{"name":"_params","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getEVMScriptRegistry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPetrified","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"appIds","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"recipient","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"contributionId","type":"uint32"}],"name":"LogMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"executor","type":"address"},{"indexed":false,"name":"script","type":"bytes"},{"indexed":false,"name":"input","type":"bytes"},{"indexed":false,"name":"returnData","type":"bytes"}],"name":"ScriptResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"vault","type":"address"},{"indexed":true,"name":"token","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"RecoverToVault","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"constant":false,"inputs":[{"name":"_appIds","type":"bytes32[5]"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"contributorAccount","type":"address"},{"name":"amount","type":"uint256"},{"name":"contributionId","type":"uint32"}],"name":"mintFor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}] \ No newline at end of file +[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"hasInitialized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getEVMScriptExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRecoveryVault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"_totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"_balances","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"}],"name":"allowRecoverability","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MINT_TOKEN_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"transferToVault","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_sender","type":"address"},{"name":"_role","type":"bytes32"},{"name":"_params","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getEVMScriptRegistry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPetrified","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"recipient","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"contributionId","type":"uint32"}],"name":"LogMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"executor","type":"address"},{"indexed":false,"name":"script","type":"bytes"},{"indexed":false,"name":"input","type":"bytes"},{"indexed":false,"name":"returnData","type":"bytes"}],"name":"ScriptResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"vault","type":"address"},{"indexed":true,"name":"token","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"RecoverToVault","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"constant":false,"inputs":[],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"contributorAccount","type":"address"},{"name":"amount","type":"uint256"},{"name":"contributionId","type":"uint32"}],"name":"mintFor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}] \ No newline at end of file diff --git a/scripts/deploy-kit.js b/scripts/deploy-kit.js index 275f92c..173306a 100644 --- a/scripts/deploy-kit.js +++ b/scripts/deploy-kit.js @@ -55,7 +55,7 @@ module.exports = async function(callback) { appIds[contractName] = namehash(`kredits-${app}.${apm}`) }) - KreditsKit.new(daoFactory.address, ensAddr, Object.values(appIds)).then((kreditsKit) => { + KreditsKit.new(daoFactory.address, ensAddr).then((kreditsKit) => { console.log(`Deployed KreditsKit at: ${kreditsKit.address}`); fileInject(path.join(__dirname, '..', 'lib/addresses/KreditsKit.json'), networkId, kreditsKit.address); -- 2.25.1 From c2dcedfe58415e4edac344ed1dff4e76e125118f Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Wed, 24 Jun 2020 01:20:04 +0200 Subject: [PATCH 02/32] Update to ethers 5 --- lib/kredits.js | 2 +- package.json | 2 +- scripts/current-address.js | 5 ++++- scripts/deploy-kit.js | 9 +++++---- scripts/helpers/init_kredits.js | 3 +-- scripts/helpers/networkid.js | 17 ----------------- scripts/helpers/update_local_networkid.js | 6 ++++-- scripts/new-dao.js | 9 ++++----- 8 files changed, 20 insertions(+), 33 deletions(-) delete mode 100644 scripts/helpers/networkid.js diff --git a/lib/kredits.js b/lib/kredits.js index caa654b..e63dda5 100644 --- a/lib/kredits.js +++ b/lib/kredits.js @@ -49,7 +49,7 @@ class Kredits { this.addresses['Kernel'] = this.addresses['Kernel'] || DaoAddresses[network.chainId.toString()]; let addressPromises = contractsToLoad.map((contractName) => { return this.Kernel.getApp(contractName).then((address) => { - this.addresses[contractName] = address; + this.addresses[contractName] = address[0]; // we get an array from the getApp response }).catch((error) => { throw new Error(`Failed to get address for ${contractName} from DAO at ${this.Kernel.contract.address} - ${error.message}` diff --git a/package.json b/package.json index 08db072..b973194 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "yargs": "^15.0.0" }, "dependencies": { - "ethers": "^4.0.47", + "ethers": "^5.0.2", "ipfs-http-client": "^41.0.1", "kosmos-schemas": "^2.2.1", "node-fetch": "^2.6.0", diff --git a/scripts/current-address.js b/scripts/current-address.js index 7776569..b4c418f 100644 --- a/scripts/current-address.js +++ b/scripts/current-address.js @@ -1,9 +1,12 @@ const knownDAOAddresses = require('../lib/addresses/dao.json'); const knownKreditsKitAddresses = require('../lib/addresses/KreditsKit.json'); const getNetworkId = require('./helpers/networkid.js') +const ethers = require('ethers'); module.exports = async function(callback) { - const networkId = await getNetworkId(web3) + const provider = new ethers.providers.Web3Provider(web3.currentProvider); + let network = await provider.getNetwork(); + let networkId = network.chainId; console.log('# All known DAO addresses'); Object.keys(knownDAOAddresses).forEach((networkId) => { diff --git a/scripts/deploy-kit.js b/scripts/deploy-kit.js index 275f92c..9c95d56 100644 --- a/scripts/deploy-kit.js +++ b/scripts/deploy-kit.js @@ -3,10 +3,10 @@ const deployDAOFactory = require('@aragon/os/scripts/deploy-daofactory.js') const fs = require('fs'); const path = require('path'); const argv = require('yargs').argv -const namehash = require('ethers').utils.namehash; +const ethers = require('ethers'); +const namehash = ethers.utils.namehash; const fileInject = require('./helpers/file_inject.js') -const getNetworkId = require('./helpers/networkid.js') const DAOFactory = artifacts.require('DAOFactory') const KreditsKit = artifacts.require('KreditsKit') @@ -26,9 +26,10 @@ const daoFactoryAddress = kreditsArappConfig.daoFactory || argv['daoFactory'] const ensAddr = arapp.environments[environment].registry || argv['ensAddress'] - module.exports = async function(callback) { - const networkId = await getNetworkId(web3) + const provider = new ethers.providers.Web3Provider(web3.currentProvider); + const network = await provider.getNetwork(); + const networkId = network.chainId; console.log(`Deploying to networkId: ${networkId}`) if (!ensAddr) { diff --git a/scripts/helpers/init_kredits.js b/scripts/helpers/init_kredits.js index e151977..9a5725d 100644 --- a/scripts/helpers/init_kredits.js +++ b/scripts/helpers/init_kredits.js @@ -1,6 +1,5 @@ const argv = require('yargs').argv; const ethers = require('ethers'); -const getNetworkId = require('./networkid.js'); const Kredits = require('../../lib/kredits'); const arapp = require('../../arapp.json'); @@ -10,7 +9,7 @@ const apm = arapp.environments[environment].apm; module.exports = async function(web3) { return new Promise((resolve, reject) => { const provider = new ethers.providers.Web3Provider(web3.currentProvider); - let signer = provider.getSigner(); + const signer = provider.getSigner(); // checking if siner supports signing transactions signer.getAddress().then(_ => { new Kredits(provider, signer, { apm }).init().then(kredits => { diff --git a/scripts/helpers/networkid.js b/scripts/helpers/networkid.js deleted file mode 100644 index a1b517d..0000000 --- a/scripts/helpers/networkid.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = function(web3) { - return new Promise((resolve, reject) => { - let func; - if (web3.version.getNetwork) { - func = web3.version.getNetwork; - } else { - func = web3.eth.net.getId; - } - func((err, network) => { - if (err) { - reject(err); - } else { - resolve(network); - } - }) - }) -} diff --git a/scripts/helpers/update_local_networkid.js b/scripts/helpers/update_local_networkid.js index b4bda0f..79575a3 100644 --- a/scripts/helpers/update_local_networkid.js +++ b/scripts/helpers/update_local_networkid.js @@ -1,12 +1,14 @@ const fs = require('fs'); -const getNetworkId = require('./networkid.js'); +const ethers = require('ethers'); module.exports = async function(callback) { const daoAddressPath = 'lib/addresses/dao.json'; // TODO maybe do the same for KreditsKit address file try { - const networkId = await getNetworkId(web3); + const provider = new ethers.providers.Web3Provider(web3.currentProvider); + const network = await provider.getNetwork(); + const networkId = network.chainId; const daoAddresses = JSON.parse(fs.readFileSync(daoAddressPath)); const oldNetworkId = Math.max(...Object.keys(daoAddresses).map(a => parseInt(a))); const localDaoAddress = daoAddresses[oldNetworkId]; diff --git a/scripts/new-dao.js b/scripts/new-dao.js index 8601034..5a022f8 100644 --- a/scripts/new-dao.js +++ b/scripts/new-dao.js @@ -3,13 +3,15 @@ const path = require('path'); const ethers = require('ethers'); const fileInject = require('./helpers/file_inject.js'); -const getNetworkId = require('./helpers/networkid.js'); const KreditsKit = require('../lib/kreditskit'); const addressesPath = path.join(__dirname, '..', 'lib/addresses'); module.exports = async function(callback) { - const networkId = await getNetworkId(web3) + const provider = new ethers.providers.Web3Provider(web3.currentProvider); + const signer = provider.getSigner(); + const network = await provider.getNetwork(); + const networkId = network.chainId; console.log(`Deploying to networkId: ${networkId}`) let kitAddresseFile = path.join(addressesPath, 'KreditsKit.json'); @@ -20,9 +22,6 @@ module.exports = async function(callback) { } console.log(`Using KreditsKit at: ${kreditsKitAddress}`); - const provider = new ethers.providers.Web3Provider(web3.currentProvider); - let signer = provider.getSigner(); - let kit = await new KreditsKit(provider, signer).init() // TODO: get rid of the hard coded gas limit -- 2.25.1 From 9648499741760c7fd1fd6ee5f5cbfb87104e7deb Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Wed, 24 Jun 2020 01:22:09 +0200 Subject: [PATCH 03/32] Return details about installed apps when creating a new Kredits DAO --- lib/kreditskit.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/kreditskit.js b/lib/kreditskit.js index 1087de6..bfd2636 100644 --- a/lib/kreditskit.js +++ b/lib/kreditskit.js @@ -37,8 +37,10 @@ class KreditsKit { return this.contract.functions.newInstance(options).then(transaction => { return transaction.wait().then(result => { const deployEvent = result.events.find(e => e.event === 'DeployInstance'); + const installedApps = result.events.filter(e => e.event === 'InstalledApp').map(e => e.args); return { daoAddress: deployEvent.args.dao, + installedApps: installedApps, transactionHash: transaction.hash, }; }); -- 2.25.1 From 17cc44cb981074b32b7732744ce5699949fc1f2f Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sat, 27 Jun 2020 16:23:15 +0200 Subject: [PATCH 04/32] Use unreleased kosmos schemas fix --- package-lock.json | 5 ++--- package.json | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index bf4b7f1..dca5890 100644 --- a/package-lock.json +++ b/package-lock.json @@ -98,9 +98,8 @@ } }, "@kosmos/schemas": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@kosmos/schemas/-/schemas-2.2.1.tgz", - "integrity": "sha512-zYUctQ91sYhzoJ0ujO73odBSsnwvdLlS6ENA/U/4/IzRKVZBj9cS4RpgFh1xOQXNN+HB4pUu8u7Su/Xtked+vg==", + "version": "github:67P/kosmos-schemas#67cc3d9d746c93907a68a7b6283bb914c283a612", + "from": "github:67P/kosmos-schemas#feature/browser-compat", "requires": { "brfs-babel": "^1.0.0" } diff --git a/package.json b/package.json index 1971184..1a90570 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "dependencies": { "ethers": "^4.0.47", "ipfs-http-client": "^41.0.1", - "@kosmos/schemas": "^2.2.1", + "@kosmos/schemas": "github:67P/kosmos-schemas#feature/browser-compat", "node-fetch": "^2.6.0", "tv4": "^1.3.0" }, -- 2.25.1 From c4e7e1259eea8e90532bbfb80946095bfa71b082 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sat, 27 Jun 2020 16:27:11 +0200 Subject: [PATCH 05/32] Remove obsolete manual expense schema import --- apps/reimbursement/contracts/Reimbursement.sol | 8 ++++---- config/seeds.js | 12 +++++------- lib/addresses/KreditsKit.json | 3 ++- lib/addresses/dao.json | 3 ++- lib/serializers/expense.js | 1 - 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/apps/reimbursement/contracts/Reimbursement.sol b/apps/reimbursement/contracts/Reimbursement.sol index f60254a..36aeae2 100644 --- a/apps/reimbursement/contracts/Reimbursement.sol +++ b/apps/reimbursement/contracts/Reimbursement.sol @@ -8,7 +8,7 @@ contract Reimbursement is AragonApp { bytes32 public constant VETO_REIMBURSEMENT_ROLE = keccak256("VETO_REIMBURSEMENT_ROLE"); struct ReimbursementData { - address requestedBy; + address recordedBy; uint32 contributorId; uint256 amount; address token; @@ -44,12 +44,12 @@ contract Reimbursement is AragonApp { } } - function get(uint32 reimbursementId) public view returns (uint32 id, address requestedBy, uint32 contributorId, uint256 amount, address token, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, uint256 confirmedAtBlock, bool exists, bool vetoed) { + function get(uint32 reimbursementId) public view returns (uint32 id, address recordedBy, uint32 contributorId, uint256 amount, address token, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, uint256 confirmedAtBlock, bool exists, bool vetoed) { id = reimbursementId; ReimbursementData storage r = reimbursements[id]; return ( id, - r.requestedBy, + r.recordedBy, r.contributorId, r.amount, r.token, @@ -65,7 +65,7 @@ contract Reimbursement is AragonApp { function add(uint256 amount, address token, uint32 contributorId, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize) public isInitialized auth(ADD_REIMBURSEMENT_ROLE) { uint32 reimbursementId = reimbursementsCount + 1; ReimbursementData storage r = reimbursements[reimbursementId]; - r.requestedBy = msg.sender; + r.recordedBy = msg.sender; r.exists = true; r.amount = amount; r.token = token; diff --git a/config/seeds.js b/config/seeds.js index ea63ec9..062cd28 100644 --- a/config/seeds.js +++ b/config/seeds.js @@ -31,16 +31,14 @@ const contractCalls = [ wiki_username: 'Manuel', }, { gasLimit: 200000 }]], - ['Proposal', 'add', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-09', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Ran the seeds', url: '' }, { gasLimit: 350000 }]], - ['Proposal', 'add', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-10', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Ran the seeds', url: '' }, { gasLimit: 350000 }]], - ['Proposal', 'add', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-11', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Hacked on kredits', url: '' }, { gasLimit: 350000 }]], - ['Proposal', 'vote', [1, { gasLimit: 550000 }]], - ['Contribution', 'add', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-11', amount: 5000, kind: 'dev', description: '[67P/kredits-contracts] Introduce contribution token', url: '' }, { gasLimit: 350000 }]], + ['Contribution', 'add', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-11', amount: 500, kind: 'dev', description: '[67P/kredits-contracts] Test this thing', url: '' }, { gasLimit: 350000 }]], ['Contribution', 'add', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-11', amount: 1500, kind: 'dev', description: '[67P/kredits-web] Reviewed stuff', url: '' }, { gasLimit: 350000 }]], - ['Contribution', 'claim', [1, { gasLimit: 300000 }]], + ['Contribution', 'add', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-11', amount: 1500, kind: 'dev', description: '[67P/kredits-contracts] Add tests', url: '' }, { gasLimit: 350000 }]], + ['Contribution', 'add', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-11', amount: 1500, kind: 'dev', description: '[67P/kredits-contracts] Introduce contribution token', url: '' }, { gasLimit: 350000 }]], + ['Contribution', 'add', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-11', amount: 5000, kind: 'dev', description: '[67P/kredits-web] Expense UI, first draft', url: '' }, { gasLimit: 350000 }]], ['Reimbursement', 'add', [{amount: 100, contributorId: 1, token: '0xa3048576e296207eb0141f2803590ad044f81928', expenses: [{title: 'Server Hosting', description: 'All the serverz', amount: 100, currency: 'EUR', date: '2020-05-28'}]}, { gasLimit: 300000 }]], - ['Reimbursement', 'add', [{amount: 10, contributorId: 1, token: '0xa3048576e296207eb0141f2803590ad044f81928', expenses: [{title: 'Domain', description: 'All the domain', amount: 10, currency: 'EUR', date: '2020-05-28'}]}, { gasLimit: 300000 }]], + ['Reimbursement', 'add', [{amount: 10, contributorId: 2, token: '0xa3048576e296207eb0141f2803590ad044f81928', expenses: [{title: 'Domain', description: 'All the domain', amount: 10, currency: 'EUR', date: '2020-05-28'}]}, { gasLimit: 300000 }]], ]; const funds = [ diff --git a/lib/addresses/KreditsKit.json b/lib/addresses/KreditsKit.json index 50044e9..6cedfdd 100644 --- a/lib/addresses/KreditsKit.json +++ b/lib/addresses/KreditsKit.json @@ -1,3 +1,4 @@ { - "4": "0x76e069b47b79442657eaf0555a32c6b16fa1b8b4" + "4": "0x76e069b47b79442657eaf0555a32c6b16fa1b8b4", + "69041181": "0x6Ad8CDF71C3E2AaD2712964097b475184a0dfDeF" } \ No newline at end of file diff --git a/lib/addresses/dao.json b/lib/addresses/dao.json index e93f248..ddb62d3 100644 --- a/lib/addresses/dao.json +++ b/lib/addresses/dao.json @@ -1,3 +1,4 @@ { - "4": "0xc34edf7d11b7f8433d597f0bb0697acdff55ef14" + "4": "0xc34edf7d11b7f8433d597f0bb0697acdff55ef14", + "69041181": "0x356685A0d9d66d6e5dA80f50EC206Af8009C8b6F" } \ No newline at end of file diff --git a/lib/serializers/expense.js b/lib/serializers/expense.js index 9309122..c2eee3c 100644 --- a/lib/serializers/expense.js +++ b/lib/serializers/expense.js @@ -1,5 +1,4 @@ let schemas = require('@kosmos/schemas'); -schemas['expense'] = require('@kosmos/schemas/schemas/expense.json'); const validator = require('../utils/validator'); /** -- 2.25.1 From bc38dcb13699305f099c58b023ad6988e0d1b4b1 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Sat, 27 Jun 2020 20:39:23 +0200 Subject: [PATCH 06/32] Copy contract data into new object to avoid object is not extensible error It seems the new ethers.js version returns contract data as a non- extensible object. We have to clone it before adding the IPFS data. --- lib/contracts/contributor.js | 3 ++- lib/utils/ipfs.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/contracts/contributor.js b/lib/contracts/contributor.js index 6a1c1ed..218e21e 100644 --- a/lib/contracts/contributor.js +++ b/lib/contracts/contributor.js @@ -9,7 +9,8 @@ class Contributor extends Record { getById (id) { return this.functions.getContributorById(id) - .then(data => { + .then(contractData => { + let data = {...contractData}; data.balanceInt = formatKredits(data.balance); return this.ipfs.catAndMerge(data, ContributorSerializer.deserialize); }); diff --git a/lib/utils/ipfs.js b/lib/utils/ipfs.js index 18b17d4..84a4692 100644 --- a/lib/utils/ipfs.js +++ b/lib/utils/ipfs.js @@ -11,7 +11,8 @@ class IPFS { this._ipfsAPI = ipfsClient(config); } - catAndMerge (data, deserialize) { + catAndMerge (contractData, deserialize) { + let data = {...contractData}; // data from ethers.js is not extensible. this copy the attributes in a new object // if no hash details are found simply return the data; nothing to merge if (!data.hashSize || data.hashSize === 0) { return data; -- 2.25.1 From c63fcc002b05c5907d3f1ebd9487ee074e80d6e9 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sun, 28 Jun 2020 00:47:24 +0200 Subject: [PATCH 07/32] Use new schemas release --- package-lock.json | 5 +++-- package.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index dca5890..afc2cf5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -98,8 +98,9 @@ } }, "@kosmos/schemas": { - "version": "github:67P/kosmos-schemas#67cc3d9d746c93907a68a7b6283bb914c283a612", - "from": "github:67P/kosmos-schemas#feature/browser-compat", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@kosmos/schemas/-/schemas-3.0.0.tgz", + "integrity": "sha512-7hnirq0ShsDjENBPjNnu6izwzVjkDzEZ4SKvPzQJJfkeJ/NRVHKvfdn9rkE7CRXTi2hMzsZVFOnlF6D/eYXTCA==", "requires": { "brfs-babel": "^1.0.0" } diff --git a/package.json b/package.json index 1a90570..61373c7 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "dependencies": { "ethers": "^4.0.47", "ipfs-http-client": "^41.0.1", - "@kosmos/schemas": "github:67P/kosmos-schemas#feature/browser-compat", + "@kosmos/schemas": "^3.0.0", "node-fetch": "^2.6.0", "tv4": "^1.3.0" }, -- 2.25.1 From 23d3dd3a80d78d58441f5729cdfd13583c5adaa3 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Mon, 29 Jun 2020 17:23:08 +0200 Subject: [PATCH 08/32] Adjust API for new ethers v5 API see issue for details: https://github.com/ethers-io/ethers.js/issues/920#issuecomment-650836642 --- lib/addresses/KreditsKit.json | 3 +- lib/addresses/dao.json | 3 +- lib/contracts/acl.js | 2 +- lib/contracts/base.js | 5 +- lib/contracts/contribution.js | 14 +-- lib/contracts/contributor.js | 10 +- lib/contracts/kernel.js | 4 +- lib/contracts/proposal.js | 6 +- lib/kredits.js | 2 +- lib/kreditskit.js | 4 +- package-lock.json | 170 ++++++++++++++++++++++++++++++++- scripts/add-contribution.js | 4 +- scripts/add-proposal.js | 4 +- scripts/claim-contributions.js | 2 +- scripts/cli.js | 4 +- scripts/list-contributions.js | 4 +- scripts/seeds.js | 2 +- scripts/veto-contribution.js | 2 +- 18 files changed, 209 insertions(+), 36 deletions(-) diff --git a/lib/addresses/KreditsKit.json b/lib/addresses/KreditsKit.json index d084ba4..22f8d67 100644 --- a/lib/addresses/KreditsKit.json +++ b/lib/addresses/KreditsKit.json @@ -1,4 +1,5 @@ { "4": "0x76e069b47b79442657eaf0555a32c6b16fa1b8b4", - "18335577": "0xeE10a87d8D758B563E301F5C5d029bDD21166DCC" + "18335577": "0xeE10a87d8D758B563E301F5C5d029bDD21166DCC", + "63732251": "0x644F88812006C631a08f786E484A21e652Bb69cc" } \ No newline at end of file diff --git a/lib/addresses/dao.json b/lib/addresses/dao.json index 012512b..3221202 100644 --- a/lib/addresses/dao.json +++ b/lib/addresses/dao.json @@ -1,4 +1,5 @@ { "4": "0xc34edf7d11b7f8433d597f0bb0697acdff55ef14", - "18335577": "0x29E33B66108fa2DC3a018f3DdE41D295eB0922D5" + "18335577": "0x29E33B66108fa2DC3a018f3DdE41D295eB0922D5", + "63732251": "0xd604112A1b9E3D83414694C778b49e664e59c19e" } \ No newline at end of file diff --git a/lib/contracts/acl.js b/lib/contracts/acl.js index d290b0b..254e7a2 100644 --- a/lib/contracts/acl.js +++ b/lib/contracts/acl.js @@ -5,7 +5,7 @@ class Acl extends Base { hasPermission (fromAddress, contractAddress, roleID, params = null) { let roleHash = EthersUtils.keccak256(EthersUtils.toUtf8Bytes(roleID)); - return this.functions.hasPermission( + return this.hasPermission( fromAddress, contractAddress, roleHash, diff --git a/lib/contracts/base.js b/lib/contracts/base.js index 9cbcb7a..3a1e846 100644 --- a/lib/contracts/base.js +++ b/lib/contracts/base.js @@ -1,10 +1,13 @@ +const deprecate = require('../utils/deprecate'); + class Base { constructor (contract) { this.contract = contract; } get functions () { - return this.contract.functions; + deprecate('The property `functions` is deprecated. contract functions are now directly defined on the ethers contract object. https://github.com/ethers-io/ethers.js/issues/920#issuecomment-650836642'); + return this.contract; } get address () { diff --git a/lib/contracts/contribution.js b/lib/contracts/contribution.js index 2856949..0f2bbb7 100644 --- a/lib/contracts/contribution.js +++ b/lib/contracts/contribution.js @@ -4,33 +4,33 @@ const deprecate = require('../utils/deprecate'); class Contribution extends Record { get count () { - return this.functions.contributionsCount(); + return this.contract.contributionsCount(); } getById (id) { - return this.functions.getContribution(id) + return this.contract.getContribution(id) .then(data => { return this.ipfs.catAndMerge(data, ContributionSerializer.deserialize); }); } getData (id) { - return this.functions.getContribution(id); + return this.contract.getContribution(id); } getByContributorId (contributorId) { - return this.functions.getContributorAddressById(contributorId) + return this.contract.getContributorAddressById(contributorId) .then(address => this.getByContributorAddress(address)); } getByContributorAddress (address) { - return this.functions.balanceOf(address) + return this.contract.balanceOf(address) .then(async (balance) => { const count = balance.toNumber(); const contributions = []; for (let index = 0; index < count; index++) { - const id = await this.functions.tokenOfOwnerByIndex(address, index); + const id = await this.contract.tokenOfOwnerByIndex(address, index); const contribution = await this.getById(id); contributions.push(contribution); } @@ -58,7 +58,7 @@ class Contribution extends Record { ipfsHashAttr.hashSize, ]; - return this.functions.add(...contribution, callOptions); + return this.contract.add(...contribution, callOptions); }); } diff --git a/lib/contracts/contributor.js b/lib/contracts/contributor.js index 218e21e..5edbfa9 100644 --- a/lib/contracts/contributor.js +++ b/lib/contracts/contributor.js @@ -4,11 +4,11 @@ const formatKredits = require('../utils/format-kredits'); class Contributor extends Record { get count () { - return this.functions.contributorsCount(); + return this.contract.contributorsCount(); } getById (id) { - return this.functions.getContributorById(id) + return this.contract.getContributorById(id) .then(contractData => { let data = {...contractData}; data.balanceInt = formatKredits(data.balance); @@ -17,7 +17,7 @@ class Contributor extends Record { } getData (id) { - return this.functions.getContributorById(id); + return this.contract.getContributorById(id); } filterByAccount (search) { @@ -62,7 +62,7 @@ class Contributor extends Record { ipfsHashAttr.hashSize, ]; - return this.functions.addContributor(...contributor, callOptions); + return this.contract.addContributor(...contributor, callOptions); }); } @@ -79,7 +79,7 @@ class Contributor extends Record { return this.ipfs .add(jsonStr) .then(ipfsHashAttr => { - return this.functions.updateContributorProfileHash( + return this.contract.updateContributorProfileHash( contributorId, ipfsHashAttr.hashDigest, ipfsHashAttr.hashFunction, diff --git a/lib/contracts/kernel.js b/lib/contracts/kernel.js index 630736a..90d6e0b 100644 --- a/lib/contracts/kernel.js +++ b/lib/contracts/kernel.js @@ -11,9 +11,9 @@ class Kernel extends Base { getApp (appName) { if (appName === 'Acl') { - return this.functions.acl(); + return this.contract.acl(); } - return this.functions.getApp(KERNEL_APP_ADDR_NAMESPACE, this.appNamehash(appName)); + return this.contract.getApp(KERNEL_APP_ADDR_NAMESPACE, this.appNamehash(appName)); } appNamehash (appName) { diff --git a/lib/contracts/proposal.js b/lib/contracts/proposal.js index e36d3ef..307ef58 100644 --- a/lib/contracts/proposal.js +++ b/lib/contracts/proposal.js @@ -4,11 +4,11 @@ const deprecate = require('../utils/deprecate'); class Proposal extends Record { get count () { - return this.functions.proposalsCount(); + return this.contract.proposalsCount(); } getById (id) { - return this.functions.getProposal(id) + return this.contract.getProposal(id) .then(data => { return this.ipfs.catAndMerge(data, ContributionSerializer.deserialize); }); @@ -33,7 +33,7 @@ class Proposal extends Record { ipfsHashAttr.hashSize, ]; - return this.functions.addProposal(...proposal, callOptions); + return this.contract.addProposal(...proposal, callOptions); }); } diff --git a/lib/kredits.js b/lib/kredits.js index e63dda5..caa654b 100644 --- a/lib/kredits.js +++ b/lib/kredits.js @@ -49,7 +49,7 @@ class Kredits { this.addresses['Kernel'] = this.addresses['Kernel'] || DaoAddresses[network.chainId.toString()]; let addressPromises = contractsToLoad.map((contractName) => { return this.Kernel.getApp(contractName).then((address) => { - this.addresses[contractName] = address[0]; // we get an array from the getApp response + this.addresses[contractName] = address; }).catch((error) => { throw new Error(`Failed to get address for ${contractName} from DAO at ${this.Kernel.contract.address} - ${error.message}` diff --git a/lib/kreditskit.js b/lib/kreditskit.js index bc08763..0a31258 100644 --- a/lib/kreditskit.js +++ b/lib/kreditskit.js @@ -30,11 +30,11 @@ class KreditsKit { appIdFor (contractName) { // see appIds in KreditsKit.sol for more details const knownContracts = ['Contribution', 'Contributor', 'Proposal', 'Token']; - return this.contract.functions.appIds(knownContracts.indexOf(contractName)); + return this.contract.appIds(knownContracts.indexOf(contractName)); } newDAO (options = {}) { - return this.contract.functions.newInstance(options).then(transaction => { + return this.contract.newInstance(options).then(transaction => { return transaction.wait().then(result => { const deployEvent = result.events.find(e => e.event === 'DeployInstance'); return { diff --git a/package-lock.json b/package-lock.json index 74be5fa..80df298 100644 --- a/package-lock.json +++ b/package-lock.json @@ -473,6 +473,12 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, + "await-semaphore": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/await-semaphore/-/await-semaphore-0.1.3.tgz", + "integrity": "sha512-d1W2aNSYcz/sxYO4pMGX9vq65qOTu0P800epMud+6cYYX0QcT7zyqcxec3VWzpgvdXo57UWmVbZpLMjX2m1I7Q==", + "dev": true + }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -1408,6 +1414,12 @@ "safe-buffer": "^5.1.2" } }, + "btoa": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz", + "integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==", + "dev": true + }, "buffer": { "version": "5.4.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.4.3.tgz", @@ -2900,6 +2912,97 @@ "js-sha3": "^0.5.7" } }, + "eth-json-rpc-errors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/eth-json-rpc-errors/-/eth-json-rpc-errors-1.1.1.tgz", + "integrity": "sha512-WT5shJ5KfNqHi9jOZD+ID8I1kuYWNrigtZat7GOQkvwo99f8SzAVaEcWhJUv656WiZOAg3P1RiJQANtUmDmbIg==", + "dev": true, + "requires": { + "fast-safe-stringify": "^2.0.6" + } + }, + "eth-json-rpc-filters": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/eth-json-rpc-filters/-/eth-json-rpc-filters-4.1.1.tgz", + "integrity": "sha512-GkXb2h6STznD+AmMzblwXgm1JMvjdK9PTIXG7BvIkTlXQ9g0QOxuU1iQRYHoslF9S30BYBSoLSisAYPdLggW+A==", + "dev": true, + "requires": { + "await-semaphore": "^0.1.3", + "eth-json-rpc-middleware": "^4.1.4", + "eth-query": "^2.1.2", + "json-rpc-engine": "^5.1.3", + "lodash.flatmap": "^4.5.0", + "safe-event-emitter": "^1.0.1" + }, + "dependencies": { + "eth-json-rpc-middleware": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/eth-json-rpc-middleware/-/eth-json-rpc-middleware-4.4.1.tgz", + "integrity": "sha512-yoSuRgEYYGFdVeZg3poWOwAlRI+MoBIltmOB86MtpoZjvLbou9EB/qWMOWSmH2ryCWLW97VYY6NWsmWm3OAA7A==", + "dev": true, + "requires": { + "btoa": "^1.2.1", + "clone": "^2.1.1", + "eth-json-rpc-errors": "^1.0.1", + "eth-query": "^2.1.2", + "eth-sig-util": "^1.4.2", + "ethereumjs-block": "^1.6.0", + "ethereumjs-tx": "^1.3.7", + "ethereumjs-util": "^5.1.2", + "ethereumjs-vm": "^2.6.0", + "fetch-ponyfill": "^4.0.0", + "json-rpc-engine": "^5.1.3", + "json-stable-stringify": "^1.0.1", + "pify": "^3.0.0", + "safe-event-emitter": "^1.0.1" + } + }, + "ethereumjs-util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", + "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", + "dev": true, + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "^0.1.3", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + }, + "json-rpc-engine": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/json-rpc-engine/-/json-rpc-engine-5.1.8.tgz", + "integrity": "sha512-vTBSDEPJV1fPAsbm2g5sEuPjsgLdiab2f1CTn2PyRr8nxggUpA996PDlNQDsM0gnrA99F8KIBLq2nIKrOFl1Mg==", + "dev": true, + "requires": { + "async": "^2.0.1", + "eth-json-rpc-errors": "^2.0.1", + "promise-to-callback": "^1.0.0", + "safe-event-emitter": "^1.0.1" + }, + "dependencies": { + "eth-json-rpc-errors": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/eth-json-rpc-errors/-/eth-json-rpc-errors-2.0.2.tgz", + "integrity": "sha512-uBCRM2w2ewusRHGxN8JhcuOb2RN3ueAOYH/0BhqdFmQkZx5lj5+fLKTz0mIVOzd4FG5/kUksCzCD7eTEim6gaA==", + "dev": true, + "requires": { + "fast-safe-stringify": "^2.0.6" + } + } + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, "eth-json-rpc-infura": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/eth-json-rpc-infura/-/eth-json-rpc-infura-3.2.1.tgz", @@ -3532,6 +3635,12 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "fast-safe-stringify": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", + "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==", + "dev": true + }, "fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", @@ -5156,6 +5265,12 @@ "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", "dev": true }, + "lodash.flatmap": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.flatmap/-/lodash.flatmap-4.5.0.tgz", + "integrity": "sha1-74y/QI9uSCaGYzRTBcaswLd4cC4=", + "dev": true + }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -8716,8 +8831,10 @@ "backoff": "^2.5.0", "clone": "^2.0.0", "cross-fetch": "^2.1.0", - "eth-block-tracker": "^3.0.0", + "eth-block-tracker": "^4.2.0", + "eth-json-rpc-filters": "^4.0.2", "eth-json-rpc-infura": "^3.1.0", + "eth-json-rpc-middleware": "^4.1.1", "eth-sig-util": "^1.4.2", "ethereumjs-block": "^1.2.2", "ethereumjs-tx": "^1.2.0", @@ -8734,6 +8851,28 @@ "xtend": "^4.0.1" }, "dependencies": { + "eth-json-rpc-middleware": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/eth-json-rpc-middleware/-/eth-json-rpc-middleware-4.4.1.tgz", + "integrity": "sha512-yoSuRgEYYGFdVeZg3poWOwAlRI+MoBIltmOB86MtpoZjvLbou9EB/qWMOWSmH2ryCWLW97VYY6NWsmWm3OAA7A==", + "dev": true, + "requires": { + "btoa": "^1.2.1", + "clone": "^2.1.1", + "eth-json-rpc-errors": "^1.0.1", + "eth-query": "^2.1.2", + "eth-sig-util": "^1.4.2", + "ethereumjs-block": "^1.6.0", + "ethereumjs-tx": "^1.3.7", + "ethereumjs-util": "^5.1.2", + "ethereumjs-vm": "^2.6.0", + "fetch-ponyfill": "^4.0.0", + "json-rpc-engine": "^5.1.3", + "json-stable-stringify": "^1.0.1", + "pify": "^3.0.0", + "safe-event-emitter": "^1.0.1" + } + }, "ethereumjs-util": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", @@ -8749,6 +8888,35 @@ "secp256k1": "^3.0.1" } }, + "json-rpc-engine": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/json-rpc-engine/-/json-rpc-engine-5.1.8.tgz", + "integrity": "sha512-vTBSDEPJV1fPAsbm2g5sEuPjsgLdiab2f1CTn2PyRr8nxggUpA996PDlNQDsM0gnrA99F8KIBLq2nIKrOFl1Mg==", + "dev": true, + "requires": { + "async": "^2.0.1", + "eth-json-rpc-errors": "^2.0.1", + "promise-to-callback": "^1.0.0", + "safe-event-emitter": "^1.0.1" + }, + "dependencies": { + "eth-json-rpc-errors": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/eth-json-rpc-errors/-/eth-json-rpc-errors-2.0.2.tgz", + "integrity": "sha512-uBCRM2w2ewusRHGxN8JhcuOb2RN3ueAOYH/0BhqdFmQkZx5lj5+fLKTz0mIVOzd4FG5/kUksCzCD7eTEim6gaA==", + "dev": true, + "requires": { + "fast-safe-stringify": "^2.0.6" + } + } + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, "readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", diff --git a/scripts/add-contribution.js b/scripts/add-contribution.js index 78b1b03..e6f79f2 100644 --- a/scripts/add-contribution.js +++ b/scripts/add-contribution.js @@ -19,10 +19,10 @@ module.exports = async function(callback) { let contributorAccount; if (contributor.length < 5) { contributorId = contributor; - contributorAccount = await kredits.Contributor.functions.getContributorAddressById(contributor); + contributorAccount = await kredits.Contributor.contract.getContributorAddressById(contributor); } else { contributorAccount = contributor; - contributorId = await kredits.Contributor.functions.getContributorIdByAddress(contributor); + contributorId = await kredits.Contributor.contract.getContributorIdByAddress(contributor); } console.log(`Creating a contribution for contributor account ${contributorAccount} ID: ${contributorId}`); diff --git a/scripts/add-proposal.js b/scripts/add-proposal.js index c99fecf..e4b9bc0 100644 --- a/scripts/add-proposal.js +++ b/scripts/add-proposal.js @@ -19,10 +19,10 @@ module.exports = async function(callback) { let contributorAccount; if (contributor.length < 5) { contributorId = contributor; - contributorAccount = await kredits.Contributor.functions.getContributorAddressById(contributor); + contributorAccount = await kredits.Contributor.contract.getContributorAddressById(contributor); } else { contributorAccount = contributor; - contributorId = await kredits.Contributor.functions.getContributorIdByAddress(contributor); + contributorId = await kredits.Contributor.contract.getContributorIdByAddress(contributor); } console.log(`Creating a proposal for contributor ID #${contributorId} account: ${contributorAccount}`); diff --git a/scripts/claim-contributions.js b/scripts/claim-contributions.js index 24598fb..2b644eb 100644 --- a/scripts/claim-contributions.js +++ b/scripts/claim-contributions.js @@ -31,7 +31,7 @@ module.exports = async function(callback) { if (c.contributorId === recipient && confirmed && !c.vetoed && !c.claimed) { console.log(`Claiming contribution ID=${c.id}`); - return kredits.Contribution.functions.claim(c.id, { gasLimit: 500000 }).then(tx => { + return kredits.Contribution.contract.claim(c.id, { gasLimit: 500000 }).then(tx => { table.push([ c.id.toString(), `${c.description}`, diff --git a/scripts/cli.js b/scripts/cli.js index 0d6753f..33f1476 100644 --- a/scripts/cli.js +++ b/scripts/cli.js @@ -17,7 +17,7 @@ module.exports = async function(callback) { method = await promptly.prompt('Function: '); } - if (!contractWrapper[method] && !contractWrapper.functions[method]) { + if (!contractWrapper[method] && !contractWrapper.contract[method]) { callback(new Error(`Method ${method} is not defined on ${contractName}`)); return; } @@ -33,7 +33,7 @@ module.exports = async function(callback) { if (contractWrapper[method]) { func = contractWrapper[method]; } else { - func = contractWrapper.functions[method]; + func = contractWrapper.contract[method]; } func.apply(contractWrapper, args).then((result) => { console.log("\nResult:"); diff --git a/scripts/list-contributions.js b/scripts/list-contributions.js index bfdc958..3cb582e 100644 --- a/scripts/list-contributions.js +++ b/scripts/list-contributions.js @@ -41,8 +41,8 @@ module.exports = async function(callback) { console.log(table.toString()); - let totalKreditsEarnedUnConfirmed = await kredits.Contribution.functions.totalKreditsEarned(false); - let totalKreditsEarnedConfirmed = await kredits.Contribution.functions.totalKreditsEarned(true); + let totalKreditsEarnedUnConfirmed = await kredits.Contribution.contract.totalKreditsEarned(false); + let totalKreditsEarnedConfirmed = await kredits.Contribution.contract.totalKreditsEarned(true); console.log(`Total Kredits: ${totalKreditsEarnedConfirmed} (confirmed) | ${totalKreditsEarnedUnConfirmed} (including unconfirmed)`); } catch (err) { console.log(err); diff --git a/scripts/seeds.js b/scripts/seeds.js index 8928419..7f628e4 100644 --- a/scripts/seeds.js +++ b/scripts/seeds.js @@ -38,7 +38,7 @@ module.exports = async function(callback) { if (contractWrapper[method]) { func = contractWrapper[method]; } else { - func = contractWrapper.functions[method]; + func = contractWrapper.contract[method]; } func.apply(contractWrapper, args).then((result) => { console.log(`[OK] kredits.${contractName}.${method}(${JSON.stringify(args)}) => ${result.hash}`); diff --git a/scripts/veto-contribution.js b/scripts/veto-contribution.js index cad4617..a66fe48 100644 --- a/scripts/veto-contribution.js +++ b/scripts/veto-contribution.js @@ -15,7 +15,7 @@ module.exports = async function(callback) { console.log(`Recording a veto for contribution #${contributionId}`); try { - kredits.Contribution.functions.veto(contributionId, { gasLimit: 300000 }) + kredits.Contribution.contract.veto(contributionId, { gasLimit: 300000 }) .then(result => { console.log("\n\nResult:"); console.log(result); -- 2.25.1 From a609d921aa88c8a8249139033e74f7faf1b9d317 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Mon, 29 Jun 2020 23:49:03 +0200 Subject: [PATCH 09/32] Remove accidentally added local DAO addresses --- lib/addresses/KreditsKit.json | 4 +--- lib/addresses/dao.json | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/addresses/KreditsKit.json b/lib/addresses/KreditsKit.json index 22f8d67..50044e9 100644 --- a/lib/addresses/KreditsKit.json +++ b/lib/addresses/KreditsKit.json @@ -1,5 +1,3 @@ { - "4": "0x76e069b47b79442657eaf0555a32c6b16fa1b8b4", - "18335577": "0xeE10a87d8D758B563E301F5C5d029bDD21166DCC", - "63732251": "0x644F88812006C631a08f786E484A21e652Bb69cc" + "4": "0x76e069b47b79442657eaf0555a32c6b16fa1b8b4" } \ No newline at end of file diff --git a/lib/addresses/dao.json b/lib/addresses/dao.json index 3221202..e93f248 100644 --- a/lib/addresses/dao.json +++ b/lib/addresses/dao.json @@ -1,5 +1,3 @@ { - "4": "0xc34edf7d11b7f8433d597f0bb0697acdff55ef14", - "18335577": "0x29E33B66108fa2DC3a018f3DdE41D295eB0922D5", - "63732251": "0xd604112A1b9E3D83414694C778b49e664e59c19e" + "4": "0xc34edf7d11b7f8433d597f0bb0697acdff55ef14" } \ No newline at end of file -- 2.25.1 From c39fe406d0291ede74c3557cd34447bfddda5f66 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Mon, 29 Jun 2020 23:49:46 +0200 Subject: [PATCH 10/32] Fix deprecation --- scripts/add-contribution.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/add-contribution.js b/scripts/add-contribution.js index e6f79f2..9594f37 100644 --- a/scripts/add-contribution.js +++ b/scripts/add-contribution.js @@ -45,7 +45,7 @@ module.exports = async function(callback) { console.log("\nAdding contribution:"); console.log(contributionAttributes); - kredits.Contribution.addContribution(contributionAttributes, { gasLimit: 300000 }) + kredits.Contribution.add(contributionAttributes, { gasLimit: 300000 }) .then(result => { console.log("\n\nResult:"); console.log(result); -- 2.25.1 From 7ad2515b67f19b084dc8131fa33555f95d71ca93 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Fri, 10 Jul 2020 00:07:06 +0200 Subject: [PATCH 11/32] Improve seeds --- config/seeds.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/config/seeds.js b/config/seeds.js index 062cd28..3a75665 100644 --- a/config/seeds.js +++ b/config/seeds.js @@ -37,8 +37,13 @@ const contractCalls = [ ['Contribution', 'add', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-11', amount: 1500, kind: 'dev', description: '[67P/kredits-contracts] Introduce contribution token', url: '' }, { gasLimit: 350000 }]], ['Contribution', 'add', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-11', amount: 5000, kind: 'dev', description: '[67P/kredits-web] Expense UI, first draft', url: '' }, { gasLimit: 350000 }]], - ['Reimbursement', 'add', [{amount: 100, contributorId: 1, token: '0xa3048576e296207eb0141f2803590ad044f81928', expenses: [{title: 'Server Hosting', description: 'All the serverz', amount: 100, currency: 'EUR', date: '2020-05-28'}]}, { gasLimit: 300000 }]], - ['Reimbursement', 'add', [{amount: 10, contributorId: 2, token: '0xa3048576e296207eb0141f2803590ad044f81928', expenses: [{title: 'Domain', description: 'All the domain', amount: 10, currency: 'EUR', date: '2020-05-28'}]}, { gasLimit: 300000 }]], + ['Reimbursement', 'add', [{amount: 1116000, contributorId: 1, token: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', expenses: [ + { title: 'Server rent', description: 'Dedicated server: andromeda.kosmos.org, April 2020', amount: 61, currency: 'EUR', date: '2020-05-28' }, + { title: 'Server rent', description: 'Dedicated server: centaurus.kosmos.org, April 2020', amount: 32, currency: 'EUR', date: '2020-05-28' } + ]}, { gasLimit: 300000 }]], + ['Reimbursement', 'add', [{amount: 166800, contributorId: 2, token: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', expenses: [ + { title: 'Domain kosmos.chat', description: 'Yearly registration fee for domain kosmos.chat', amount: 13.90, currency: 'EUR', date: '2020-05-30' } + ]}, { gasLimit: 300000 }]], ]; const funds = [ -- 2.25.1 From 4add0c7d96400f8943d6818e865f9a08e5ba9a37 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Fri, 17 Jul 2020 13:22:24 +0200 Subject: [PATCH 12/32] package-lock --- package-lock.json | 593 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 532 insertions(+), 61 deletions(-) diff --git a/package-lock.json b/package-lock.json index 80df298..ed10244 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,6 +43,21 @@ "@babel/highlight": "^7.8.3" } }, + "@babel/helper-module-imports": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", + "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", + "dev": true + }, "@babel/helper-validator-identifier": { "version": "7.9.5", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", @@ -97,6 +112,469 @@ } } }, + "@babel/plugin-transform-runtime": { + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.10.5.tgz", + "integrity": "sha512-tV4V/FjElJ9lQtyjr5xD2IFFbgY46r7EeVu5a8CpEKT5laheHKSlFeHjpkPppW3PqzGLAuv5k2qZX5LgVZIX5w==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "resolve": "^1.8.1", + "semver": "^5.5.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "@babel/runtime": { + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.5.tgz", + "integrity": "sha512-otddXKhdNn7d0ptoFRHtMLa8LqDxLYwTjB4nYgM1yy5N6gU/MUf8zqyyLltCH3yAVitBzmwK4us+DD0l/MauAg==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.13.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", + "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.5.tgz", + "integrity": "sha512-ixV66KWfCI6GKoA/2H9v6bQdbfXEwwpOdQ8cRvb4F+eyvhlaHxWFMQB4+3d9QFJXZsiiiqVrewNV0DFEQpyT4Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", + "dev": true + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + } + } + }, + "@ethersproject/abi": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.0.1.tgz", + "integrity": "sha512-9fqSa3jEYV4nN8tijW+jz4UnT/Ma9/b8y4+nHlsvuWqr32E2kYsT9SCIVpk/51iM6NOud7xsA6UxCox9zBeHKg==", + "requires": { + "@ethersproject/address": "^5.0.0", + "@ethersproject/bignumber": "^5.0.0", + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/constants": "^5.0.0", + "@ethersproject/hash": "^5.0.0", + "@ethersproject/keccak256": "^5.0.0", + "@ethersproject/logger": "^5.0.0", + "@ethersproject/properties": "^5.0.0", + "@ethersproject/strings": "^5.0.0" + } + }, + "@ethersproject/abstract-provider": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.0.1.tgz", + "integrity": "sha512-/KOw65ayviYPtKLqFE1qozeIJJlfI1wE/tNA+iKUPUai6bU6vg2tbfLFGarRTCQe3HoWV1t7xSsD/z9T9xg74g==", + "requires": { + "@ethersproject/bignumber": "^5.0.0", + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/logger": "^5.0.0", + "@ethersproject/networks": "^5.0.0", + "@ethersproject/properties": "^5.0.0", + "@ethersproject/transactions": "^5.0.0", + "@ethersproject/web": "^5.0.0" + } + }, + "@ethersproject/abstract-signer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.0.1.tgz", + "integrity": "sha512-Rp8DP+cLcSNFkd1YhwPSBcgEWLRipNakitwIwHngAmhbo4zdiWgALD/OLqdQ7SKF75CufF1W4BCuXcQgiWaRow==", + "requires": { + "@ethersproject/abstract-provider": "^5.0.0", + "@ethersproject/bignumber": "^5.0.0", + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/logger": "^5.0.0", + "@ethersproject/properties": "^5.0.0" + } + }, + "@ethersproject/address": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.0.1.tgz", + "integrity": "sha512-kfQtXpBP2pI2TfoRRAYv8grHGiYw8U0c1KbMsC58/W33TIBy7gFSf/oAzOd94lNzdIUenKU0OuSzrHQfVcDDDA==", + "requires": { + "@ethersproject/bignumber": "^5.0.0", + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/keccak256": "^5.0.0", + "@ethersproject/logger": "^5.0.0", + "@ethersproject/rlp": "^5.0.0", + "bn.js": "^4.4.0" + } + }, + "@ethersproject/base64": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.0.1.tgz", + "integrity": "sha512-WZDa+TYl6BQfUm9EQIDDfJFL0GiuYXNZPIWoiZx3uds7P1XMsvcW3k71AyjYUxIkU5AKW7awwPbzCbBeP1uXsA==", + "requires": { + "@ethersproject/bytes": "^5.0.0" + } + }, + "@ethersproject/basex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.0.1.tgz", + "integrity": "sha512-ssL2+p/A5bZgkZkiWy0iQDVz2mVJxZfzpf7dpw8t0sKF9VpoM3ZiMthRapH/QBhd4Rr6TNbr619pFLAGmMi9Ug==", + "requires": { + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/properties": "^5.0.0" + } + }, + "@ethersproject/bignumber": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.0.4.tgz", + "integrity": "sha512-fgfwehdxS4BPRvq2B+joKqchW2E2cV3DE+O/DhG7jH3m2blM1VIzjtIOtJNjNI/YCgkygGjT1DaZS1j29RAwHw==", + "requires": { + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/logger": "^5.0.0", + "@ethersproject/properties": "^5.0.0", + "bn.js": "^4.4.0" + } + }, + "@ethersproject/bytes": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.0.2.tgz", + "integrity": "sha512-QLE5zCreNv7KGh0AsXdvmdOYcWSJbnR654M+dLyY90g3D0ehVDSf+wxzG/GmWa79ESsqo/cWC1kJA1Vrcq7GFw==", + "requires": { + "@ethersproject/logger": "^5.0.0" + } + }, + "@ethersproject/constants": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.0.1.tgz", + "integrity": "sha512-Xec07hFCPN4wfC3WDiRay7KipkApl2msiKTrBHCuAwNMOM8M92+mlQp8tgfEL51DPwCZkmdk1f02kArc6caVSw==", + "requires": { + "@ethersproject/bignumber": "^5.0.0" + } + }, + "@ethersproject/contracts": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.0.1.tgz", + "integrity": "sha512-1uPajmkvw3Oy/dxs5TKUsGaXzQ3s5qiXKSVpw9ZrhGG6fMRO3gNyUA+uSWk9IXK0ulj5P95F7vW8HmYOkzep/Q==", + "requires": { + "@ethersproject/abi": "^5.0.0", + "@ethersproject/abstract-provider": "^5.0.0", + "@ethersproject/abstract-signer": "^5.0.0", + "@ethersproject/address": "^5.0.0", + "@ethersproject/bignumber": "^5.0.0", + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/constants": "^5.0.0", + "@ethersproject/logger": "^5.0.0", + "@ethersproject/properties": "^5.0.0" + } + }, + "@ethersproject/hash": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.0.1.tgz", + "integrity": "sha512-1ByUXYvkszrSSks07xctBtZfpFnIVmftxWlAAnguxh6Q65vKECd/EPi5uI5xVOvnrYMH9Vb8MK1SofPX/6fArQ==", + "requires": { + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/keccak256": "^5.0.0", + "@ethersproject/logger": "^5.0.0", + "@ethersproject/strings": "^5.0.0" + } + }, + "@ethersproject/hdnode": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.0.1.tgz", + "integrity": "sha512-L2OZP4SKKxNtHUdwfK8cND09kHRH62ncxXW33WAJU9shKo8Sbz31HVqSdov84bMAGm8QfEKZbfbAJV/7DM6DjQ==", + "requires": { + "@ethersproject/abstract-signer": "^5.0.0", + "@ethersproject/basex": "^5.0.0", + "@ethersproject/bignumber": "^5.0.0", + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/logger": "^5.0.0", + "@ethersproject/pbkdf2": "^5.0.0", + "@ethersproject/properties": "^5.0.0", + "@ethersproject/sha2": "^5.0.0", + "@ethersproject/signing-key": "^5.0.0", + "@ethersproject/strings": "^5.0.0", + "@ethersproject/transactions": "^5.0.0", + "@ethersproject/wordlists": "^5.0.0" + } + }, + "@ethersproject/json-wallets": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.0.1.tgz", + "integrity": "sha512-QjqQCh1a0a6wRVHdnqVccCLWX0vAgxnvGZeGqpOk2NbyNE8HTzV7GpOE+4LU+iCc8oonfy1gYd4hpsf+iEUWGg==", + "requires": { + "@ethersproject/abstract-signer": "^5.0.0", + "@ethersproject/address": "^5.0.0", + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/hdnode": "^5.0.0", + "@ethersproject/keccak256": "^5.0.0", + "@ethersproject/logger": "^5.0.0", + "@ethersproject/pbkdf2": "^5.0.0", + "@ethersproject/properties": "^5.0.0", + "@ethersproject/random": "^5.0.0", + "@ethersproject/strings": "^5.0.0", + "@ethersproject/transactions": "^5.0.0", + "aes-js": "3.0.0", + "scrypt-js": "3.0.1", + "uuid": "2.0.1" + }, + "dependencies": { + "aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=" + }, + "uuid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" + } + } + }, + "@ethersproject/keccak256": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.0.1.tgz", + "integrity": "sha512-AtFm/4qHRQUvZcG3WYmaT7zV79dz72+N01w0XphcIBaD/7UZXyW85Uf08sirVlckHmh9fvc4UDWyHiroKsBT6Q==", + "requires": { + "@ethersproject/bytes": "^5.0.0", + "js-sha3": "0.5.7" + } + }, + "@ethersproject/logger": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.0.2.tgz", + "integrity": "sha512-NQe3O1/Nwkcp6bto6hsTvrcCeR/cOGK+RhOMn0Zi2FND6gdWsf1g+5ie8gQ1REqDX4MTGP/Y131dZas985ls/g==" + }, + "@ethersproject/networks": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.0.1.tgz", + "integrity": "sha512-Pe34JCTC6Apm/DkK3z97xotvEyu9YHKIFlDIu5hGV6yFDb4/sUfY2SHKYSGdUrV0418ZZVrwYDveJtBFMmYu2Q==", + "requires": { + "@ethersproject/logger": "^5.0.0" + } + }, + "@ethersproject/pbkdf2": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.0.1.tgz", + "integrity": "sha512-4wc8Aov0iJmiomu6Dv1JNGOlhm3L7omITjLmChz/vgeDnW4Unv4J/nGybCeWKgY4hnjyQMVXkdkQ15BCRbkaYg==", + "requires": { + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/sha2": "^5.0.0" + } + }, + "@ethersproject/properties": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.0.1.tgz", + "integrity": "sha512-b3VZ/NpYIf64/hFXeWNxVCbY1xoMPIYM3n6Qnu6Ayr3bLt1olFPQfAaaRB0aOsLz7tMtmkT3DrA1KG/IrOgBRw==", + "requires": { + "@ethersproject/logger": "^5.0.0" + } + }, + "@ethersproject/providers": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.0.4.tgz", + "integrity": "sha512-bnju7KB3v+NDcbHYxbZJawb20WRh/FLhop/XvHBmGUAbYSCV+cRftRvvgsdeyJOApjsCioMtmIe5iYkRxDx/DA==", + "requires": { + "@ethersproject/abstract-provider": "^5.0.0", + "@ethersproject/abstract-signer": "^5.0.0", + "@ethersproject/address": "^5.0.0", + "@ethersproject/bignumber": "^5.0.0", + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/constants": "^5.0.0", + "@ethersproject/hash": "^5.0.0", + "@ethersproject/logger": "^5.0.0", + "@ethersproject/networks": "^5.0.0", + "@ethersproject/properties": "^5.0.0", + "@ethersproject/random": "^5.0.0", + "@ethersproject/rlp": "^5.0.0", + "@ethersproject/strings": "^5.0.0", + "@ethersproject/transactions": "^5.0.0", + "@ethersproject/web": "^5.0.0", + "ws": "7.2.3" + }, + "dependencies": { + "ws": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.3.tgz", + "integrity": "sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ==" + } + } + }, + "@ethersproject/random": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.0.1.tgz", + "integrity": "sha512-nYzNhcp5Th4dCocV3yceZmh80bRmSQxqNRgND7Y/YgEgYJSSnknScpfRHACG//kgbsY8zui8ajXJeEnzS7yFbQ==", + "requires": { + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/logger": "^5.0.0" + } + }, + "@ethersproject/rlp": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.0.1.tgz", + "integrity": "sha512-3F8XE1zS4w8w4xiK1hMtFuVs6UnhQlmrEHLT85GanqK8vG5wGi81IQmkukL9tQIu2a5jykoO46ibja+6N1fpFg==", + "requires": { + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/logger": "^5.0.0" + } + }, + "@ethersproject/sha2": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.0.1.tgz", + "integrity": "sha512-5wNdULNDMJKwyzqrTH66e2TZPZTSqqluS7RNtuuuQSTP+yIALoID7ewLjDoj31g4kZyq/pqQbackKJLOXejTKw==", + "requires": { + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/logger": "^5.0.0", + "hash.js": "1.1.3" + } + }, + "@ethersproject/signing-key": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.0.2.tgz", + "integrity": "sha512-kgpCdtgoLoKXJTwJPw3ggRW7EO93YCQ98zY8hBpIb4OK3FxFCR3UUjlrGEwjMnLHDjFrxpKCeJagGWf477RyMQ==", + "requires": { + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/logger": "^5.0.0", + "@ethersproject/properties": "^5.0.0", + "elliptic": "6.5.3" + }, + "dependencies": { + "elliptic": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + } + } + }, + "@ethersproject/solidity": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.0.1.tgz", + "integrity": "sha512-3L+xI1LaJmd2zBJxnK9Y4cd1vb2aJLFvL6fxvjWpzcMiFiZ4dbPwj3kharv5f5mAlbGwAs6NiPJaFWvbOpm96Q==", + "requires": { + "@ethersproject/bignumber": "^5.0.0", + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/keccak256": "^5.0.0", + "@ethersproject/sha2": "^5.0.0", + "@ethersproject/strings": "^5.0.0" + } + }, + "@ethersproject/strings": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.0.1.tgz", + "integrity": "sha512-N8LxdHGBT7GZdogkEOV5xKXYTz5PNHuNzcxLNPYfH3kpvWSyXshZBgAz8YE1a8sMZagGj+Ic6d3mHijdCTSkGA==", + "requires": { + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/constants": "^5.0.0", + "@ethersproject/logger": "^5.0.0" + } + }, + "@ethersproject/transactions": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.0.1.tgz", + "integrity": "sha512-IGc6/5hri3PrqR/ZCj89osDiq3Lt0CSrycn6vlRl8SjpBKYDdcT+Ru5xkeC7YcsnqcdBmTL+jyR3SLudU+x2Kw==", + "requires": { + "@ethersproject/address": "^5.0.0", + "@ethersproject/bignumber": "^5.0.0", + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/constants": "^5.0.0", + "@ethersproject/keccak256": "^5.0.0", + "@ethersproject/logger": "^5.0.0", + "@ethersproject/properties": "^5.0.0", + "@ethersproject/rlp": "^5.0.0", + "@ethersproject/signing-key": "^5.0.0" + } + }, + "@ethersproject/units": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.0.1.tgz", + "integrity": "sha512-7J7Jmm4hMZ+yFiqEd7D5oeVK/V74GDwQlT0Om1yxXLYX6UPcV5ChHkUz/xpHPT9JXQlQ+2D69HBf1dzvdflrmQ==", + "requires": { + "@ethersproject/bignumber": "^5.0.0", + "@ethersproject/constants": "^5.0.0", + "@ethersproject/logger": "^5.0.0" + } + }, + "@ethersproject/wallet": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.0.1.tgz", + "integrity": "sha512-1/QPpFngJtUGtdVOLSoIN3vf+zEWyEVxQ0lhRCwGkiBqL2SoVoDHB7/nCfcv7wwlZkdnegFfo/8DxeyYjTZN7w==", + "requires": { + "@ethersproject/abstract-provider": "^5.0.0", + "@ethersproject/abstract-signer": "^5.0.0", + "@ethersproject/address": "^5.0.0", + "@ethersproject/bignumber": "^5.0.0", + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/hash": "^5.0.0", + "@ethersproject/hdnode": "^5.0.0", + "@ethersproject/json-wallets": "^5.0.0", + "@ethersproject/keccak256": "^5.0.0", + "@ethersproject/logger": "^5.0.0", + "@ethersproject/properties": "^5.0.0", + "@ethersproject/random": "^5.0.0", + "@ethersproject/signing-key": "^5.0.0", + "@ethersproject/transactions": "^5.0.0", + "@ethersproject/wordlists": "^5.0.0" + } + }, + "@ethersproject/web": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.0.1.tgz", + "integrity": "sha512-lWPg8BR6KoyiIKYRIM6j+XO9bT9vGM1JnxFj2HmhIvOrOjba7ZRd8ANBOsDVGfw5igLUdfqAUOf9WpSsH//TzA==", + "requires": { + "@ethersproject/base64": "^5.0.0", + "@ethersproject/logger": "^5.0.0", + "@ethersproject/properties": "^5.0.0", + "@ethersproject/strings": "^5.0.0" + } + }, + "@ethersproject/wordlists": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.0.1.tgz", + "integrity": "sha512-R7boLmpewucz5v4jD7cWwI0BGHR/DstiZtjdhUOft6XdMqM1OGb1UTL0GBQeS4vDXzCLuJEHddjJ69beGVN/4Q==", + "requires": { + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/hash": "^5.0.0", + "@ethersproject/logger": "^5.0.0", + "@ethersproject/properties": "^5.0.0", + "@ethersproject/strings": "^5.0.0" + } + }, "@resolver-engine/core": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/@resolver-engine/core/-/core-0.2.1.tgz", @@ -2304,6 +2782,7 @@ "version": "6.5.2", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", + "dev": true, "requires": { "bn.js": "^4.4.0", "brorand": "^1.0.1", @@ -2870,38 +3349,6 @@ "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", "dev": true }, - "eth-block-tracker": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/eth-block-tracker/-/eth-block-tracker-3.0.1.tgz", - "integrity": "sha512-WUVxWLuhMmsfenfZvFO5sbl1qFY2IqUlw/FPVmjjdElpqLsZtSG+wPe9Dz7W/sB6e80HgFKknOmKk2eNlznHug==", - "dev": true, - "requires": { - "eth-query": "^2.1.0", - "ethereumjs-tx": "^1.3.3", - "ethereumjs-util": "^5.1.3", - "ethjs-util": "^0.1.3", - "json-rpc-engine": "^3.6.0", - "pify": "^2.3.0", - "tape": "^4.6.3" - }, - "dependencies": { - "ethereumjs-util": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", - "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", - "dev": true, - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "^0.1.3", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - } - } - }, "eth-ens-namehash": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz", @@ -3417,31 +3864,39 @@ } }, "ethers": { - "version": "4.0.47", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.47.tgz", - "integrity": "sha512-hssRYhngV4hiDNeZmVU/k5/E8xmLG8UpcNUzg6mb7lqhgpFPH/t7nuv20RjRrEf0gblzvi2XwR5Te+V3ZFc9pQ==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.0.5.tgz", + "integrity": "sha512-hkVI7fi16ADWTctYMEfamU39hoR+JpkdEI7LH8PC7Bhl0Dp8y8dqFJ948pSEuuPJI5NR/L4+V6y2Alvyu+zROw==", "requires": { - "aes-js": "3.0.0", - "bn.js": "^4.4.0", - "elliptic": "6.5.2", - "hash.js": "1.1.3", - "js-sha3": "0.5.7", - "scrypt-js": "2.0.4", - "setimmediate": "1.0.4", - "uuid": "2.0.1", - "xmlhttprequest": "1.8.0" - }, - "dependencies": { - "aes-js": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", - "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=" - }, - "uuid": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", - "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" - } + "@ethersproject/abi": "^5.0.0", + "@ethersproject/abstract-provider": "^5.0.0", + "@ethersproject/abstract-signer": "^5.0.0", + "@ethersproject/address": "^5.0.0", + "@ethersproject/base64": "^5.0.0", + "@ethersproject/bignumber": "^5.0.0", + "@ethersproject/bytes": "^5.0.0", + "@ethersproject/constants": "^5.0.0", + "@ethersproject/contracts": "^5.0.0", + "@ethersproject/hash": "^5.0.0", + "@ethersproject/hdnode": "^5.0.0", + "@ethersproject/json-wallets": "^5.0.0", + "@ethersproject/keccak256": "^5.0.0", + "@ethersproject/logger": "^5.0.0", + "@ethersproject/networks": "^5.0.0", + "@ethersproject/pbkdf2": "^5.0.0", + "@ethersproject/properties": "^5.0.0", + "@ethersproject/providers": "^5.0.0", + "@ethersproject/random": "^5.0.0", + "@ethersproject/rlp": "^5.0.0", + "@ethersproject/sha2": "^5.0.0", + "@ethersproject/signing-key": "^5.0.0", + "@ethersproject/solidity": "^5.0.0", + "@ethersproject/strings": "^5.0.0", + "@ethersproject/transactions": "^5.0.0", + "@ethersproject/units": "^5.0.0", + "@ethersproject/wallet": "^5.0.0", + "@ethersproject/web": "^5.0.0", + "@ethersproject/wordlists": "^5.0.0" } }, "ethjs-unit": { @@ -6828,9 +7283,9 @@ } }, "scrypt-js": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz", - "integrity": "sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" }, "scrypt.js": { "version": "0.3.0", @@ -7000,7 +7455,8 @@ "setimmediate": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", - "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=" + "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=", + "dev": true }, "setprototypeof": { "version": "1.1.1", @@ -8851,6 +9307,20 @@ "xtend": "^4.0.1" }, "dependencies": { + "eth-block-tracker": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/eth-block-tracker/-/eth-block-tracker-4.4.3.tgz", + "integrity": "sha512-A8tG4Z4iNg4mw5tP1Vung9N9IjgMNqpiMoJ/FouSFwNCGHv2X0mmOYwtQOJzki6XN7r7Tyo01S29p7b224I4jw==", + "dev": true, + "requires": { + "@babel/plugin-transform-runtime": "^7.5.5", + "@babel/runtime": "^7.5.5", + "eth-query": "^2.1.0", + "json-rpc-random-id": "^1.0.1", + "pify": "^3.0.0", + "safe-event-emitter": "^1.0.1" + } + }, "eth-json-rpc-middleware": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/eth-json-rpc-middleware/-/eth-json-rpc-middleware-4.4.1.tgz", @@ -9210,7 +9680,8 @@ "xmlhttprequest": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", - "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" + "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=", + "dev": true }, "xtend": { "version": "4.0.1", -- 2.25.1 From 8f0d7e519614d402fd895326e5c099ba3397a515 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Fri, 17 Jul 2020 13:22:59 +0200 Subject: [PATCH 13/32] 6.0.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ed10244..cb6a7d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "kredits-contracts", - "version": "5.5.0", + "version": "6.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -9916,4 +9916,4 @@ } } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index b973194..07e8b89 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kredits-contracts", - "version": "5.5.0", + "version": "6.0.0", "description": "Ethereum contracts and npm wrapper for Kredits", "main": "./lib/kredits.js", "directories": { -- 2.25.1 From 15b47dbc42ecca20252dcff5e468b0e7ff537065 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Thu, 1 Oct 2020 12:15:48 +0200 Subject: [PATCH 14/32] Improve Reimbursement.add validation --- lib/contracts/reimbursement.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/contracts/reimbursement.js b/lib/contracts/reimbursement.js index 585037a..ff027cb 100644 --- a/lib/contracts/reimbursement.js +++ b/lib/contracts/reimbursement.js @@ -25,10 +25,21 @@ class Reimbursement extends Record { const token = attrs.token; const contributorId = attrs.contributorId; const expenses = attrs.expenses.map( e => new ExpenseSerializer(e) ); + let errorMessage; - if (!amount > 0 || !token || token === '' || !contributorId || contributorId === '' || !expenses.length > 0) { - return Promise.reject(new Error('Invalid data. amount, token, expenses is required.')); + if (typeof amount !== 'number' || amount <= 0) { + errorMessage = 'Invalid data: amount must be a positive number.'; } + if (!token || token === '') { + errorMessage = 'Invalid data: token must be a token address.'; + } + if (!contributorId || contributorId === '') { + errorMessage = 'Invalid data: contributorId is required.'; + } + if (expenses.length === 0) { + errorMessage = 'Invalid data: at least one expense item is required.'; + } + if (errorMessage) { return Promise.reject(new Error(errorMessage)); } return Promise.all(expenses.map(e => e.validate())) .then(() => { @@ -39,7 +50,7 @@ class Reimbursement extends Record { const reimbursement = [ amount, token, - contributorId, + parseInt(contributorId), ipfsHashAttr.hashDigest, ipfsHashAttr.hashFunction, ipfsHashAttr.hashSize, -- 2.25.1 From e6349f059454c38abf48e244f7dba21d2b32e228 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Thu, 1 Oct 2020 16:12:13 +0200 Subject: [PATCH 15/32] Some minor improvements of ExpenseSerializer --- lib/serializers/expense.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/serializers/expense.js b/lib/serializers/expense.js index c2eee3c..9c1dbf9 100644 --- a/lib/serializers/expense.js +++ b/lib/serializers/expense.js @@ -1,4 +1,4 @@ -let schemas = require('@kosmos/schemas'); +const schemas = require('@kosmos/schemas'); const validator = require('../utils/validator'); /** @@ -7,7 +7,7 @@ const validator = require('../utils/validator'); * @class * @public */ -class Expense { +class ExpenseSerializer { constructor (attrs) { Object.keys(attrs).forEach(a => this[a] = attrs[a]); @@ -24,7 +24,7 @@ class Expense { } get data () { - let { + const { title, description, currency, @@ -35,7 +35,7 @@ class Expense { details, } = this; - let data = { + const data = { '@context': 'https://schema.kosmos.org', '@type': 'Expense', title, @@ -71,7 +71,7 @@ class Expense { * @public */ static deserialize (serialized) { - let { + const { title, description, currency, @@ -97,4 +97,4 @@ class Expense { } -module.exports = Expense; +module.exports = ExpenseSerializer; -- 2.25.1 From 7dba0e4501cd2029046b65eb505de7204328f5dd Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Tue, 20 Oct 2020 10:44:29 +0200 Subject: [PATCH 16/32] Add missing permission assignment Fixes reimbursement transaction failures. Co-authored-by: Michael Bumann --- contracts/KreditsKit.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/KreditsKit.sol b/contracts/KreditsKit.sol index d90c3c3..92c8bc0 100644 --- a/contracts/KreditsKit.sol +++ b/contracts/KreditsKit.sol @@ -59,6 +59,7 @@ contract KreditsKit is KitBase { acl.grantPermissionP(acl.ANY_ENTITY(), contribution, contribution.ADD_CONTRIBUTION_ROLE(), params); acl.grantPermissionP(acl.ANY_ENTITY(), contribution, contribution.VETO_CONTRIBUTION_ROLE(), params); acl.grantPermissionP(acl.ANY_ENTITY(), contributor, contributor.MANAGE_CONTRIBUTORS_ROLE(), params); + acl.grantPermissionP(acl.ANY_ENTITY(), reimbursement, reimbursement.ADD_REIMBURSEMENT_ROLE(), params); //acl.setPermissionManager(this, proposal, proposal.VOTE_PROPOSAL_ROLE(); acl.createPermission(root, proposal, proposal.VOTE_PROPOSAL_ROLE(), this); -- 2.25.1 From e3c03bf4a08ccfcd05ce8629e29e8b5907b1f019 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Tue, 17 Nov 2020 12:29:50 +0100 Subject: [PATCH 17/32] Update README Add note about having to use node.js 12 for now. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 73fd7af..682df8b 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,9 @@ Aragon CLI and Truffle need to be installed on your sytem as well: npm install -g @aragon/cli npm install -g truffle +_Note: `@aragon/cli` currently fails to install on node.js 14. Please use +node.js 12 until the issue has been resolved upstream._ + ### Local development chain For local development it is recommended to use -- 2.25.1 From 32b212f9cfb2739f530f820e6167f50c79c6eaea Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Wed, 18 Nov 2020 17:31:10 +0100 Subject: [PATCH 18/32] Use legacy node.js in CI Courtesy of aragon CLI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 94eee3e..0496fc9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ --- language: node_js node_js: - - "lts/*" + - "12" sudo: false dist: xenial -- 2.25.1 From eadca6904a7aed7d90258fb5d1d2f619f1dc47e8 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Tue, 1 Dec 2020 10:23:49 +0100 Subject: [PATCH 19/32] Rename contributor to recipient And remove addedBy entry. --- apps/reimbursement/contracts/Reimbursement.sol | 13 +++++-------- lib/contracts/reimbursement.js | 8 ++++---- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/apps/reimbursement/contracts/Reimbursement.sol b/apps/reimbursement/contracts/Reimbursement.sol index 36aeae2..93d66f8 100644 --- a/apps/reimbursement/contracts/Reimbursement.sol +++ b/apps/reimbursement/contracts/Reimbursement.sol @@ -8,8 +8,7 @@ contract Reimbursement is AragonApp { bytes32 public constant VETO_REIMBURSEMENT_ROLE = keccak256("VETO_REIMBURSEMENT_ROLE"); struct ReimbursementData { - address recordedBy; - uint32 contributorId; + uint32 recipientId; uint256 amount; address token; bytes32 hashDigest; @@ -44,13 +43,12 @@ contract Reimbursement is AragonApp { } } - function get(uint32 reimbursementId) public view returns (uint32 id, address recordedBy, uint32 contributorId, uint256 amount, address token, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, uint256 confirmedAtBlock, bool exists, bool vetoed) { + function get(uint32 reimbursementId) public view returns (uint32 id, uint32 recipientId, uint256 amount, address token, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize, uint256 confirmedAtBlock, bool exists, bool vetoed) { id = reimbursementId; ReimbursementData storage r = reimbursements[id]; return ( id, - r.recordedBy, - r.contributorId, + r.recipientId, r.amount, r.token, r.hashDigest, @@ -62,14 +60,13 @@ contract Reimbursement is AragonApp { ); } - function add(uint256 amount, address token, uint32 contributorId, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize) public isInitialized auth(ADD_REIMBURSEMENT_ROLE) { + function add(uint256 amount, address token, uint32 recipientId, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize) public isInitialized auth(ADD_REIMBURSEMENT_ROLE) { uint32 reimbursementId = reimbursementsCount + 1; ReimbursementData storage r = reimbursements[reimbursementId]; - r.recordedBy = msg.sender; r.exists = true; r.amount = amount; r.token = token; - r.contributorId = contributorId; + r.recipientId = recipientId; r.hashDigest = hashDigest; r.hashFunction = hashFunction; r.hashSize = hashSize; diff --git a/lib/contracts/reimbursement.js b/lib/contracts/reimbursement.js index ff027cb..24c992f 100644 --- a/lib/contracts/reimbursement.js +++ b/lib/contracts/reimbursement.js @@ -23,7 +23,7 @@ class Reimbursement extends Record { async add (attrs, callOptions = {}) { const amount = parseInt(attrs.amount); const token = attrs.token; - const contributorId = attrs.contributorId; + const recipientId = attrs.recipientId; const expenses = attrs.expenses.map( e => new ExpenseSerializer(e) ); let errorMessage; @@ -33,8 +33,8 @@ class Reimbursement extends Record { if (!token || token === '') { errorMessage = 'Invalid data: token must be a token address.'; } - if (!contributorId || contributorId === '') { - errorMessage = 'Invalid data: contributorId is required.'; + if (!recipientId || recipientId === '') { + errorMessage = 'Invalid data: recipientId is required.'; } if (expenses.length === 0) { errorMessage = 'Invalid data: at least one expense item is required.'; @@ -50,7 +50,7 @@ class Reimbursement extends Record { const reimbursement = [ amount, token, - parseInt(contributorId), + parseInt(recipientId), ipfsHashAttr.hashDigest, ipfsHashAttr.hashFunction, ipfsHashAttr.hashSize, -- 2.25.1 From dc353445704f520dddefda012231d4ccdc9b54db Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Tue, 1 Dec 2020 12:22:31 +0100 Subject: [PATCH 20/32] Add function to configure the associated apps --- apps/contribution/arapp.json | 5 +++++ apps/contribution/contracts/Contribution.sol | 6 ++++++ apps/contributor/arapp.json | 5 +++++ apps/contributor/contracts/Contributor.sol | 6 ++++++ apps/proposal/arapp.json | 5 +++++ apps/proposal/contracts/Proposal.sol | 6 ++++++ lib/abis/Contribution.json | 2 +- lib/abis/Contributor.json | 2 +- 8 files changed, 35 insertions(+), 2 deletions(-) diff --git a/apps/contribution/arapp.json b/apps/contribution/arapp.json index 942ec44..e1f2449 100644 --- a/apps/contribution/arapp.json +++ b/apps/contribution/arapp.json @@ -14,6 +14,11 @@ "name": "Veto contributions", "id": "VETO_CONTRIBUTION_ROLE", "params": [] + }, + { + "name": "Manage connected apps", + "id": "MANAGE_APPS_ROLE", + "params": [] } ], "environments": { diff --git a/apps/contribution/contracts/Contribution.sol b/apps/contribution/contracts/Contribution.sol index dd02a68..e4e5851 100644 --- a/apps/contribution/contracts/Contribution.sol +++ b/apps/contribution/contracts/Contribution.sol @@ -17,6 +17,7 @@ interface ContributorInterface { contract Contribution is AragonApp { bytes32 public constant ADD_CONTRIBUTION_ROLE = keccak256("ADD_CONTRIBUTION_ROLE"); bytes32 public constant VETO_CONTRIBUTION_ROLE = keccak256("VETO_CONTRIBUTION_ROLE"); + bytes32 public constant MANAGE_APPS_ROLE = keccak256("MANAGE_APPS_ROLE"); IToken public kreditsToken; ContributorInterface public kreditsContributor; @@ -59,6 +60,11 @@ contract Contribution is AragonApp { initialized(); } + function setApps(address _token, address _contributor) public isInitialized auth(MANAGE_APPS_ROLE) { + kreditsToken = IToken(_token); + kreditsContributor = ContributorInterface(_contributor); + } + // // Token standard functions (ERC 721) // diff --git a/apps/contributor/arapp.json b/apps/contributor/arapp.json index e26fa44..e3c2f9f 100644 --- a/apps/contributor/arapp.json +++ b/apps/contributor/arapp.json @@ -4,6 +4,11 @@ "name": "Manage contributors", "id": "MANAGE_CONTRIBUTORS_ROLE", "params": [] + }, + { + "name": "Manage connected apps", + "id": "MANAGE_APPS_ROLE", + "params": [] } ], "environments": { diff --git a/apps/contributor/contracts/Contributor.sol b/apps/contributor/contracts/Contributor.sol index 131a997..503352a 100644 --- a/apps/contributor/contracts/Contributor.sol +++ b/apps/contributor/contracts/Contributor.sol @@ -13,6 +13,7 @@ interface IContributionBalance { contract Contributor is AragonApp { bytes32 public constant MANAGE_CONTRIBUTORS_ROLE = keccak256("MANAGE_CONTRIBUTORS_ROLE"); + bytes32 public constant MANAGE_APPS_ROLE = keccak256("MANAGE_APPS_ROLE"); ITokenBalance public kreditsToken; IContributionBalance public kreditsContribution; @@ -39,6 +40,11 @@ contract Contributor is AragonApp { initialized(); } + function setApps(address _contribution, address _token) public isInitialized auth(MANAGE_APPS_ROLE) { + kreditsToken = ITokenBalance(_token); + kreditsContribution = IContributionBalance(_contribution); + } + function coreContributorsCount() public view returns (uint32) { uint32 count = 0; for (uint32 i = 1; i <= contributorsCount; i++) { diff --git a/apps/proposal/arapp.json b/apps/proposal/arapp.json index 255d894..becb554 100644 --- a/apps/proposal/arapp.json +++ b/apps/proposal/arapp.json @@ -9,6 +9,11 @@ "name": "Vote proposals", "id": "VOTE_PROPOSAL_ROLE", "params": [] + }, + { + "name": "Manage connected apps", + "id": "MANAGE_APPS_ROLE", + "params": [] } ], "environments": { diff --git a/apps/proposal/contracts/Proposal.sol b/apps/proposal/contracts/Proposal.sol index 3eb0a02..28ef383 100644 --- a/apps/proposal/contracts/Proposal.sol +++ b/apps/proposal/contracts/Proposal.sol @@ -17,6 +17,7 @@ contract Proposal is AragonApp { bytes32 public constant ADD_PROPOSAL_ROLE = keccak256("ADD_PROPOSAL_ROLE"); bytes32 public constant VOTE_PROPOSAL_ROLE = keccak256("VOTE_PROPOSAL_ROLE"); + bytes32 public constant MANAGE_APPS_ROLE = keccak256("MANAGE_APPS_ROLE"); IContributor public kreditsContributor; IContribution public kreditsContribution; @@ -50,6 +51,11 @@ contract Proposal is AragonApp { initialized(); } + function setApps(address _contributor, address _contribution) public isInitialized auth(MANAGE_APPS_ROLE) { + kreditsContributor = IContributor(_contributor); + kreditsContribution = IContribution(_contribution); + } + function addProposal(uint32 contributorId, uint32 amount, bytes32 hashDigest, uint8 hashFunction, uint8 hashSize) public isInitialized auth(ADD_PROPOSAL_ROLE) { require(kreditsContributor.exists(contributorId), 'CONTRIBUTOR_NOT_FOUND'); diff --git a/lib/abis/Contribution.json b/lib/abis/Contribution.json index 2201fe1..e4f435e 100644 --- a/lib/abis/Contribution.json +++ b/lib/abis/Contribution.json @@ -1 +1 @@ -[{"constant":true,"inputs":[],"name":"hasInitialized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kreditsContributor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ADD_CONTRIBUTION_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getEVMScriptExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRecoveryVault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"contributionsCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"}],"name":"allowRecoverability","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"transferToVault","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_sender","type":"address"},{"name":"_role","type":"bytes32"},{"name":"_params","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getEVMScriptRegistry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"contributionOwner","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kreditsToken","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"contributions","outputs":[{"name":"contributorId","type":"uint32"},{"name":"amount","type":"uint32"},{"name":"claimed","type":"bool"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"tokenMetadataURL","type":"string"},{"name":"confirmedAtBlock","type":"uint256"},{"name":"vetoed","type":"bool"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"},{"name":"","type":"uint256"}],"name":"ownedContributions","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"blocksToWait","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPetrified","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"VETO_CONTRIBUTION_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":true,"name":"contributorId","type":"uint32"},{"indexed":false,"name":"amount","type":"uint32"}],"name":"ContributionAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":true,"name":"contributorId","type":"uint32"},{"indexed":false,"name":"amount","type":"uint32"}],"name":"ContributionClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"vetoedByAccount","type":"address"}],"name":"ContributionVetoed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"executor","type":"address"},{"indexed":false,"name":"script","type":"bytes"},{"indexed":false,"name":"input","type":"bytes"},{"indexed":false,"name":"returnData","type":"bytes"}],"name":"ScriptResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"vault","type":"address"},{"indexed":true,"name":"token","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"RecoverToVault","type":"event"},{"constant":false,"inputs":[{"name":"_token","type":"address"},{"name":"_contributor","type":"address"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"ownerOf","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"index","type":"uint32"}],"name":"tokenOfOwnerByIndex","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"tokenMetadata","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"confirmedOnly","type":"bool"}],"name":"totalKreditsEarned","outputs":[{"name":"amount","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"contributorId","type":"uint32"},{"name":"confirmedOnly","type":"bool"}],"name":"totalKreditsEarnedByContributor","outputs":[{"name":"amount","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"getContribution","outputs":[{"name":"id","type":"uint32"},{"name":"contributorId","type":"uint32"},{"name":"amount","type":"uint32"},{"name":"claimed","type":"bool"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"confirmedAtBlock","type":"uint256"},{"name":"exists","type":"bool"},{"name":"vetoed","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint32"},{"name":"contributorId","type":"uint32"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"}],"name":"add","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"veto","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"claim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"exists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"}] \ No newline at end of file +[{"constant":true,"inputs":[],"name":"hasInitialized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kreditsContributor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ADD_CONTRIBUTION_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getEVMScriptExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRecoveryVault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"contributionsCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"}],"name":"allowRecoverability","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MANAGE_APPS_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"transferToVault","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_sender","type":"address"},{"name":"_role","type":"bytes32"},{"name":"_params","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getEVMScriptRegistry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"contributionOwner","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kreditsToken","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"contributions","outputs":[{"name":"contributorId","type":"uint32"},{"name":"amount","type":"uint32"},{"name":"claimed","type":"bool"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"tokenMetadataURL","type":"string"},{"name":"confirmedAtBlock","type":"uint256"},{"name":"vetoed","type":"bool"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"},{"name":"","type":"uint256"}],"name":"ownedContributions","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"blocksToWait","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPetrified","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"VETO_CONTRIBUTION_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":true,"name":"contributorId","type":"uint32"},{"indexed":false,"name":"amount","type":"uint32"}],"name":"ContributionAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":true,"name":"contributorId","type":"uint32"},{"indexed":false,"name":"amount","type":"uint32"}],"name":"ContributionClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"vetoedByAccount","type":"address"}],"name":"ContributionVetoed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"executor","type":"address"},{"indexed":false,"name":"script","type":"bytes"},{"indexed":false,"name":"input","type":"bytes"},{"indexed":false,"name":"returnData","type":"bytes"}],"name":"ScriptResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"vault","type":"address"},{"indexed":true,"name":"token","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"RecoverToVault","type":"event"},{"constant":false,"inputs":[{"name":"_token","type":"address"},{"name":"_contributor","type":"address"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"},{"name":"_contributor","type":"address"}],"name":"setApps","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"ownerOf","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"index","type":"uint32"}],"name":"tokenOfOwnerByIndex","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"tokenMetadata","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"confirmedOnly","type":"bool"}],"name":"totalKreditsEarned","outputs":[{"name":"amount","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"contributorId","type":"uint32"},{"name":"confirmedOnly","type":"bool"}],"name":"totalKreditsEarnedByContributor","outputs":[{"name":"amount","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"getContribution","outputs":[{"name":"id","type":"uint32"},{"name":"contributorId","type":"uint32"},{"name":"amount","type":"uint32"},{"name":"claimed","type":"bool"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"confirmedAtBlock","type":"uint256"},{"name":"exists","type":"bool"},{"name":"vetoed","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint32"},{"name":"contributorId","type":"uint32"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"}],"name":"add","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"veto","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"claim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"contributionId","type":"uint32"}],"name":"exists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"}] \ No newline at end of file diff --git a/lib/abis/Contributor.json b/lib/abis/Contributor.json index 45c241a..0a183af 100644 --- a/lib/abis/Contributor.json +++ b/lib/abis/Contributor.json @@ -1 +1 @@ -[{"constant":true,"inputs":[],"name":"hasInitialized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getEVMScriptExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRecoveryVault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"contributorsCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"}],"name":"allowRecoverability","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"contributorIds","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"KERNEL_APP_ADDR_NAMESPACE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"transferToVault","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"MANAGE_CONTRIBUTORS_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"contributors","outputs":[{"name":"account","type":"address"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getEVMScriptRegistry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kreditsToken","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPetrified","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kreditsContribution","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"oldHashDigest","type":"bytes32"},{"indexed":false,"name":"newHashDigest","type":"bytes32"}],"name":"ContributorProfileUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"oldAccount","type":"address"},{"indexed":false,"name":"newAccount","type":"address"}],"name":"ContributorAccountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"account","type":"address"}],"name":"ContributorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"executor","type":"address"},{"indexed":false,"name":"script","type":"bytes"},{"indexed":false,"name":"input","type":"bytes"},{"indexed":false,"name":"returnData","type":"bytes"}],"name":"ScriptResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"vault","type":"address"},{"indexed":true,"name":"token","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"RecoverToVault","type":"event"},{"constant":false,"inputs":[{"name":"_contribution","type":"address"},{"name":"_token","type":"address"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"coreContributorsCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint32"},{"name":"oldAccount","type":"address"},{"name":"newAccount","type":"address"}],"name":"updateContributorAccount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint32"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"}],"name":"updateContributorProfileHash","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"}],"name":"addContributor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint32"}],"name":"isCoreTeam","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint32"}],"name":"exists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"addressIsCore","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"addressExists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"getContributorIdByAddress","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint32"}],"name":"getContributorAddressById","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint32"}],"name":"getContributorById","outputs":[{"name":"id","type":"uint32"},{"name":"account","type":"address"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"isCore","type":"bool"},{"name":"balance","type":"uint256"},{"name":"totalKreditsEarned","type":"uint32"},{"name":"contributionsCount","type":"uint256"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_sender","type":"address"},{"name":"_role","type":"bytes32"},{"name":"_params","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_who","type":"address"},{"name":"_where","type":"address"},{"name":"_what","type":"bytes32"},{"name":"_how","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}] \ No newline at end of file +[{"constant":true,"inputs":[],"name":"hasInitialized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_script","type":"bytes"}],"name":"getEVMScriptExecutor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRecoveryVault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"contributorsCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"}],"name":"allowRecoverability","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"contributorIds","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"transferToVault","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"MANAGE_CONTRIBUTORS_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"contributors","outputs":[{"name":"account","type":"address"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getEVMScriptRegistry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kreditsToken","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kernel","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPetrified","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kreditsContribution","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"oldHashDigest","type":"bytes32"},{"indexed":false,"name":"newHashDigest","type":"bytes32"}],"name":"ContributorProfileUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"oldAccount","type":"address"},{"indexed":false,"name":"newAccount","type":"address"}],"name":"ContributorAccountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint32"},{"indexed":false,"name":"account","type":"address"}],"name":"ContributorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"executor","type":"address"},{"indexed":false,"name":"script","type":"bytes"},{"indexed":false,"name":"input","type":"bytes"},{"indexed":false,"name":"returnData","type":"bytes"}],"name":"ScriptResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"vault","type":"address"},{"indexed":true,"name":"token","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"RecoverToVault","type":"event"},{"constant":false,"inputs":[{"name":"_contribution","type":"address"},{"name":"_token","type":"address"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"coreContributorsCount","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint32"},{"name":"oldAccount","type":"address"},{"name":"newAccount","type":"address"}],"name":"updateContributorAccount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint32"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"}],"name":"updateContributorProfileHash","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"}],"name":"addContributor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint32"}],"name":"isCoreTeam","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint32"}],"name":"exists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"addressIsCore","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"addressExists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"getContributorIdByAddress","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint32"}],"name":"getContributorAddressById","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint32"}],"name":"getContributorById","outputs":[{"name":"id","type":"uint32"},{"name":"account","type":"address"},{"name":"hashDigest","type":"bytes32"},{"name":"hashFunction","type":"uint8"},{"name":"hashSize","type":"uint8"},{"name":"isCore","type":"bool"},{"name":"balance","type":"uint256"},{"name":"totalKreditsEarned","type":"uint32"},{"name":"contributionsCount","type":"uint256"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_sender","type":"address"},{"name":"_role","type":"bytes32"},{"name":"_params","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_who","type":"address"},{"name":"_where","type":"address"},{"name":"_what","type":"bytes32"},{"name":"_how","type":"uint256[]"}],"name":"canPerform","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}] \ No newline at end of file -- 2.25.1 From 9df58b7f9a248625d8f4e29228d79ee971a7009e Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Tue, 1 Dec 2020 12:51:33 +0100 Subject: [PATCH 21/32] Fix seeds --- config/seeds.js | 2 +- scripts/list-reimbursements.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/seeds.js b/config/seeds.js index 3a75665..2a3517e 100644 --- a/config/seeds.js +++ b/config/seeds.js @@ -41,7 +41,7 @@ const contractCalls = [ { title: 'Server rent', description: 'Dedicated server: andromeda.kosmos.org, April 2020', amount: 61, currency: 'EUR', date: '2020-05-28' }, { title: 'Server rent', description: 'Dedicated server: centaurus.kosmos.org, April 2020', amount: 32, currency: 'EUR', date: '2020-05-28' } ]}, { gasLimit: 300000 }]], - ['Reimbursement', 'add', [{amount: 166800, contributorId: 2, token: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', expenses: [ + ['Reimbursement', 'add', [{amount: 166800, recipientId: 2, token: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', expenses: [ { title: 'Domain kosmos.chat', description: 'Yearly registration fee for domain kosmos.chat', amount: 13.90, currency: 'EUR', date: '2020-05-30' } ]}, { gasLimit: 300000 }]], ]; diff --git a/scripts/list-reimbursements.js b/scripts/list-reimbursements.js index 86a9be4..c46f522 100644 --- a/scripts/list-reimbursements.js +++ b/scripts/list-reimbursements.js @@ -15,7 +15,7 @@ module.exports = async function(callback) { console.log(`Using Reimbursement at: ${kredits.Reimbursement.contract.address}`); const table = new Table({ - head: ['ID', 'Amount', 'Token', 'ContributorId', 'Confirmed?', 'Vetoed?', 'IPFS', 'Expenses'] + head: ['ID', 'Amount', 'Token', 'recipientId', 'Confirmed?', 'Vetoed?', 'IPFS', 'Expenses'] }) try { @@ -31,7 +31,7 @@ module.exports = async function(callback) { r.id.toString(), r.amount.toString(), `${r.token}`, - `${r.contributorId}`, + `${r.recipientId}`, `${confirmed}`, `${r.vetoed}`, `${r.ipfsHash}`, -- 2.25.1 From 6bc6bcb7f60eac3806c0459cfcf63e3e24566f4d Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Tue, 1 Dec 2020 12:54:28 +0100 Subject: [PATCH 22/32] We don't use those helpers right now. but maybe later? --- apps/reimbursement/test/helpers/dao.js | 4 ++++ apps/reimbursement/test/helpers/permissions.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/apps/reimbursement/test/helpers/dao.js b/apps/reimbursement/test/helpers/dao.js index 9f12dc4..4faedb9 100644 --- a/apps/reimbursement/test/helpers/dao.js +++ b/apps/reimbursement/test/helpers/dao.js @@ -1,3 +1,5 @@ +/* + const { hash } = require('eth-ens-namehash') const { getEventArgument } = require('@aragon/contract-test-helpers/events') const Kernel = artifacts.require('@aragon/os/build/contracts/kernel/Kernel') @@ -59,3 +61,5 @@ module.exports = { newDao, newApp, } + +*/ diff --git a/apps/reimbursement/test/helpers/permissions.js b/apps/reimbursement/test/helpers/permissions.js index 633142c..eec7a65 100644 --- a/apps/reimbursement/test/helpers/permissions.js +++ b/apps/reimbursement/test/helpers/permissions.js @@ -1,3 +1,5 @@ +/* + const ANY_ADDRESS = '0xffffffffffffffffffffffffffffffffffffffff' const setOpenPermission = async (acl, appAddress, role, rootAddress) => { @@ -15,3 +17,5 @@ const setOpenPermission = async (acl, appAddress, role, rootAddress) => { module.exports = { setOpenPermission } + +*/ -- 2.25.1 From b22d16e61ef284ec2431978e6daeb6b45e9df155 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Tue, 1 Dec 2020 13:26:38 +0100 Subject: [PATCH 23/32] We do not need the appIds in the reimbursement app this might make it easier to deploy? --- apps/reimbursement/contracts/Reimbursement.sol | 8 +++++--- contracts/KreditsKit.sol | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/reimbursement/contracts/Reimbursement.sol b/apps/reimbursement/contracts/Reimbursement.sol index 93d66f8..952e973 100644 --- a/apps/reimbursement/contracts/Reimbursement.sol +++ b/apps/reimbursement/contracts/Reimbursement.sol @@ -6,6 +6,7 @@ import "@aragon/os/contracts/kernel/IKernel.sol"; contract Reimbursement is AragonApp { bytes32 public constant ADD_REIMBURSEMENT_ROLE = keccak256("ADD_REIMBURSEMENT_ROLE"); bytes32 public constant VETO_REIMBURSEMENT_ROLE = keccak256("VETO_REIMBURSEMENT_ROLE"); + // bytes32 public constant MANAGE_APPS_ROLE = keccak256("MANAGE_APPS_ROLE"); struct ReimbursementData { uint32 recipientId; @@ -27,13 +28,14 @@ contract Reimbursement is AragonApp { event ReimbursementAdded(uint32 id, address indexed addedByAccount, uint256 amount); event ReimbursementVetoed(uint32 id, address vetoedByAccount); - // TODO: remove _appIds when those are removed from the kreditskit - // using the appids to find other apps is wrong according to aragon - function initialize(bytes32[5] _appIds) public onlyInit { + function initialize() public onlyInit { blocksToWait = 40320; // 7 days; 15 seconds block time initialized(); } + // function setApps() public isInitialized auth(MANAGE_APPS_ROLE) { + // } + function totalAmount(bool confirmedOnly) public view returns (uint256 amount) { for (uint32 i = 1; i <= reimbursementsCount; i++) { ReimbursementData memory r = reimbursements[i]; diff --git a/contracts/KreditsKit.sol b/contracts/KreditsKit.sol index 92c8bc0..56c4222 100644 --- a/contracts/KreditsKit.sol +++ b/contracts/KreditsKit.sol @@ -50,7 +50,7 @@ contract KreditsKit is KitBase { proposal.initialize(appIds); Reimbursement reimbursement = Reimbursement(_installApp(dao, appIds[uint8(Apps.Reimbursement)])); - reimbursement.initialize(appIds); + reimbursement.initialize(); acl.createPermission(root, reimbursement, reimbursement.ADD_REIMBURSEMENT_ROLE(), this); acl.createPermission(root, reimbursement, reimbursement.VETO_REIMBURSEMENT_ROLE(), this); -- 2.25.1 From eebc0db02bfe541cc317ea5e70e88a7f65dd5922 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Wed, 16 Dec 2020 17:19:31 +0100 Subject: [PATCH 24/32] Add script to count contributions between a certain block timeframe --- scripts/list-contributions-per-contributor.js | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 scripts/list-contributions-per-contributor.js diff --git a/scripts/list-contributions-per-contributor.js b/scripts/list-contributions-per-contributor.js new file mode 100644 index 0000000..8a874e2 --- /dev/null +++ b/scripts/list-contributions-per-contributor.js @@ -0,0 +1,73 @@ +const promptly = require('promptly'); +const Table = require('cli-table'); + +const initKredits = require('./helpers/init_kredits.js'); + +module.exports = async function(callback) { + let kredits; + try { + kredits = await initKredits(web3); + } catch(e) { + callback(e); + return; + } + + console.log(`Using Contribution at: ${kredits.Contribution.contract.address}`); + + const table = new Table({ + head: ['ID', 'Name', 'Kredits'] + }) + + try { + let currentBlockNumber = await kredits.provider.getBlockNumber(); + console.log(`Current block number: ${currentBlockNumber}`); + + let confirmedBeforeBlock = await promptly.prompt('Before block: '); + let confirmedAfterBlock = await promptly.prompt('After block: '); + + let contributionId = await kredits.Contribution.contract.contributionsCount(); + let nextContribution = true; + + let contributors = {}; + + while (nextContribution) { + console.log(`Getting contribution: ${contributionId}`); + let contribution = await kredits.Contribution.getById(contributionId); + contributionId = contributionId - 1; + + // check if the contribution is older + // in that case we assume all other contributions now are older + if (contribution.confirmedAtBlock < confirmedAfterBlock) { + nextContribution = false; + } + + // if the contribution is within the range count it + if (!contribution.vetoed && contribution.confirmedAtBlock < confirmedBeforeBlock && contribution.confirmedAtBlock > confirmedAfterBlock) { + // init + if (!contributors[contribution.conributorId]) { + contributors[contribution.contributorId] = 0; + } + contributors[contribution.contributorId] += contribution.amount; + } + } + console.log(contributors); + const promise = Object.keys(contributors).map((contributorId) => { + return kredits.Contributor.getById(contributorId).then(contributorId => { + table.push([ + contributorId, + `${contributor.name}`, + `${contributors[conributorId]}` + ]); + }); + }); + + Promise.all(promise).then(() => { + console.log(`Total Kredits: ${Object.values(contributors).reduce((a,b) => {return a+b},0)}`); + console.log(table.toString()); + }); + } catch (err) { + console.log(err); + } + + callback(); +} -- 2.25.1 From 0df7930e062c208ad97103a31e9151dae3109880 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Tue, 22 Dec 2020 12:28:34 +0100 Subject: [PATCH 25/32] Get it running --- scripts/list-contributions-per-contributor.js | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/scripts/list-contributions-per-contributor.js b/scripts/list-contributions-per-contributor.js index 8a874e2..e951733 100644 --- a/scripts/list-contributions-per-contributor.js +++ b/scripts/list-contributions-per-contributor.js @@ -25,16 +25,25 @@ module.exports = async function(callback) { let confirmedBeforeBlock = await promptly.prompt('Before block: '); let confirmedAfterBlock = await promptly.prompt('After block: '); + let tokens = {}; + let contributors = await kredits.Contributor.all(); + contributors.forEach(c => { + tokens[c.id] = { amount: 0, contributor: c }; + }); + let contributionId = await kredits.Contribution.contract.contributionsCount(); let nextContribution = true; - let contributors = {}; - while (nextContribution) { console.log(`Getting contribution: ${contributionId}`); let contribution = await kredits.Contribution.getById(contributionId); contributionId = contributionId - 1; + // if no conribution is found + if (!contribution.exists) { + nextContribution = false; + break; + } // check if the contribution is older // in that case we assume all other contributions now are older if (contribution.confirmedAtBlock < confirmedAfterBlock) { @@ -44,27 +53,21 @@ module.exports = async function(callback) { // if the contribution is within the range count it if (!contribution.vetoed && contribution.confirmedAtBlock < confirmedBeforeBlock && contribution.confirmedAtBlock > confirmedAfterBlock) { // init - if (!contributors[contribution.conributorId]) { - contributors[contribution.contributorId] = 0; - } - contributors[contribution.contributorId] += contribution.amount; + tokens[contribution.contributorId].amount = tokens[contribution.contributorId].amount + contribution.amount; } } - console.log(contributors); - const promise = Object.keys(contributors).map((contributorId) => { - return kredits.Contributor.getById(contributorId).then(contributorId => { - table.push([ - contributorId, - `${contributor.name}`, - `${contributors[conributorId]}` - ]); - }); + + Object.keys(tokens).forEach((contributorId) => { + table.push([ + contributorId, + `${tokens[contributorId].contributor.name}`, + `${tokens[contributorId].amount}` + ]); }); - Promise.all(promise).then(() => { - console.log(`Total Kredits: ${Object.values(contributors).reduce((a,b) => {return a+b},0)}`); - console.log(table.toString()); - }); + const total = Object.keys(tokens).map(cid => { return tokens[cid].amount}).reduce((a,b) => { return a+b }, 0); + console.log(`Total confirmed Kredits: ${total} between block ${confirmedAfterBlock} and ${confirmedBeforeBlock}`); + console.log(table.toString()); } catch (err) { console.log(err); } -- 2.25.1 From 2238ccf40e98d4abd46377dd293ad6b0a0e27c5e Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Thu, 14 Jan 2021 15:36:55 +0100 Subject: [PATCH 26/32] Fix confirmations being 1 block too late block.number refers to the last mined block, so we need to add +1 to wait from the current block on (the one in which this function is executed). --- apps/contribution/contracts/Contribution.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/contribution/contracts/Contribution.sol b/apps/contribution/contracts/Contribution.sol index 89bdfc7..e17f160 100644 --- a/apps/contribution/contracts/Contribution.sol +++ b/apps/contribution/contracts/Contribution.sol @@ -164,7 +164,7 @@ contract Contribution is AragonApp { if (contributionId < 10) { c.confirmedAtBlock = block.number; } else { - c.confirmedAtBlock = block.number + blocksToWait; + c.confirmedAtBlock = block.number + 1 + blocksToWait; } contributionsCount++; -- 2.25.1 From 8984ba380268b6dae6bab1e398102e0c62b01c61 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Thu, 14 Jan 2021 15:39:19 +0100 Subject: [PATCH 27/32] Improve variable name clarity --- apps/contribution/contracts/Contribution.sol | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/contribution/contracts/Contribution.sol b/apps/contribution/contracts/Contribution.sol index 89bdfc7..82089e8 100644 --- a/apps/contribution/contracts/Contribution.sol +++ b/apps/contribution/contracts/Contribution.sol @@ -66,13 +66,13 @@ contract Contribution is AragonApp { } function getContributorIdByAddress(address contributorAccount) public view returns (uint32) { - address contributor = getContract(uint8(Apps.Contributor)); - return ContributorInterface(contributor).getContributorIdByAddress(contributorAccount); + address contributorContract = getContract(uint8(Apps.Contributor)); + return ContributorInterface(contributorContract).getContributorIdByAddress(contributorAccount); } function getContributorAddressById(uint32 contributorId) public view returns (address) { - address contributor = getContract(uint8(Apps.Contributor)); - return ContributorInterface(contributor).getContributorAddressById(contributorId); + address contributorContract = getContract(uint8(Apps.Contributor)); + return ContributorInterface(contributorContract).getContributorAddressById(contributorId); } // @@ -175,7 +175,7 @@ contract Contribution is AragonApp { emit ContributionAdded(contributionId, contributorId, amount); } - function veto(uint32 contributionId) public isInitialized auth(VETO_CONTRIBUTION_ROLE) { + function veto(uint32 contributionId) public isInitialized { ContributionData storage c = contributions[contributionId]; require(c.exists, 'NOT_FOUND'); require(!c.claimed, 'ALREADY_CLAIMED'); @@ -193,10 +193,10 @@ contract Contribution is AragonApp { require(block.number >= c.confirmedAtBlock, 'NOT_CLAIMABLE'); c.claimed = true; - address token = getContract(uint8(Apps.Token)); + address tokenContract = getContract(uint8(Apps.Token)); address contributorAccount = getContributorAddressById(c.contributorId); uint256 amount = uint256(c.amount); - IToken(token).mintFor(contributorAccount, amount, contributionId); + IToken(tokenContract).mintFor(contributorAccount, amount, contributionId); emit ContributionClaimed(contributionId, c.contributorId, c.amount); } -- 2.25.1 From 6c80179a3dd5853d7bd49ae59c1c83efd3ce89dd Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Thu, 14 Jan 2021 15:46:33 +0100 Subject: [PATCH 28/32] Re-add veto auth Accidentally merged during pairing with some minor changes in #210 --- apps/contribution/contracts/Contribution.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/contribution/contracts/Contribution.sol b/apps/contribution/contracts/Contribution.sol index ff40354..2d0b9dc 100644 --- a/apps/contribution/contracts/Contribution.sol +++ b/apps/contribution/contracts/Contribution.sol @@ -175,7 +175,7 @@ contract Contribution is AragonApp { emit ContributionAdded(contributionId, contributorId, amount); } - function veto(uint32 contributionId) public isInitialized { + function veto(uint32 contributionId) public isInitialized auth(VETO_CONTRIBUTION_ROLE) { ContributionData storage c = contributions[contributionId]; require(c.exists, 'NOT_FOUND'); require(!c.claimed, 'ALREADY_CLAIMED'); -- 2.25.1 From 357698db0264b27f85ee68aaf526edfd4d1b8ca4 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Fri, 19 Feb 2021 10:24:54 +0100 Subject: [PATCH 29/32] Deployment details --- deployments/rinkeby/contribution.md | 30 +++++++++++++++++++++++++++++ deployments/rinkeby/dao.md | 11 +++++++++++ 2 files changed, 41 insertions(+) diff --git a/deployments/rinkeby/contribution.md b/deployments/rinkeby/contribution.md index adfc21d..f43b5d9 100644 --- a/deployments/rinkeby/contribution.md +++ b/deployments/rinkeby/contribution.md @@ -2,6 +2,36 @@ aragon apm publish major --environment=rinkeby" +## 20212-01-14 + +apps/contribution@master » aragon apm publish major --environment=rinkeby +eth-provider | Invalid provider preset/location: "local" + ✔ Start IPFS + ✔ Applying version bump (major) + ↓ Building frontend [skipped] + → build script not defined in package.json + ✔ Deploy contract + ✔ Determine contract address for version + ✔ Prepare files for publishing + ✔ Generate application artifact + ✔ Publish intent + +⚠ Publishing files from the project's root folder is not recommended. Consider using the distribution folder of your project: "--files ". + + The following information will be published: + Contract address: 0x914Da982ef17B56D2e868E3a67E923EbED1aE017 + Content (ipfs): QmdVrY2R48NFqwLopd8ix1anAK1d6WafDGauou3ZJrB9gf + +? Publish to kredits-contribution.open.aragonpm.eth repo Yes + + ✔ Publish kredits-contribution.open.aragonpm.eth + + Successfully published kredits-contribution.open.aragonpm.eth v7.0.0 : + +Transaction hash: 0xb817b2e80e90a6be60b45dd39987498e3132c9962c0501feb7549ad30186c6d5 + + + ## 2019-04-24 update balances ✔ Successfully published kredits-contribution.open.aragonpm.eth v6.0.0: diff --git a/deployments/rinkeby/dao.md b/deployments/rinkeby/dao.md index e1ade80..aba26dc 100644 --- a/deployments/rinkeby/dao.md +++ b/deployments/rinkeby/dao.md @@ -1,5 +1,16 @@ # Kredits deployment + +## 2021-01-14 + +apps/contribution@master » aragon dao upgrade 0xc34edf7d11b7f8433d597f0bb0697acdff55ef14 kredits-contribution.open.aragonpm.eth --environment=rinkeby +eth-provider | Invalid provider preset/location: "local" + ✔ Fetching kredits-contribution.open.aragonpm.eth@latest + ✔ Fetching kredits-contribution.open.aragonpm.eth@latest + ✔ Upgrading app + +✔ Successfully executed: "Upgrade 'kredits-contribution.open.aragonpm.eth' app instances to v7.0.0" + ## 2019-04-25 canPerfom fix aragon dao upgrade 0xc34edf7d11b7f8433d597f0bb0697acdff55ef14 kredits-contributor.open.aragonpm.eth --environment=rinkeby -- 2.25.1 From 44cad2d26ea979a0bd8562d9665566befbd9fdcb Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Mon, 22 Feb 2021 15:32:43 +0100 Subject: [PATCH 30/32] Fix contributorId being used in a reimbursement seed --- config/seeds.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/seeds.js b/config/seeds.js index 2a3517e..98728a8 100644 --- a/config/seeds.js +++ b/config/seeds.js @@ -37,7 +37,7 @@ const contractCalls = [ ['Contribution', 'add', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-11', amount: 1500, kind: 'dev', description: '[67P/kredits-contracts] Introduce contribution token', url: '' }, { gasLimit: 350000 }]], ['Contribution', 'add', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-11', amount: 5000, kind: 'dev', description: '[67P/kredits-web] Expense UI, first draft', url: '' }, { gasLimit: 350000 }]], - ['Reimbursement', 'add', [{amount: 1116000, contributorId: 1, token: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', expenses: [ + ['Reimbursement', 'add', [{amount: 1116000, recipientId: 1, token: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', expenses: [ { title: 'Server rent', description: 'Dedicated server: andromeda.kosmos.org, April 2020', amount: 61, currency: 'EUR', date: '2020-05-28' }, { title: 'Server rent', description: 'Dedicated server: centaurus.kosmos.org, April 2020', amount: 32, currency: 'EUR', date: '2020-05-28' } ]}, { gasLimit: 300000 }]], -- 2.25.1 From f11c4f7764c393412e9d2d935263f849067b74e4 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Thu, 20 May 2021 15:09:56 +0200 Subject: [PATCH 31/32] Add script for finding block closest to given date Useful for manual grant cycle management. --- package-lock.json | 19 +++++++++++++++++-- package.json | 1 + scripts/find-block-for-date.js | 19 +++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 scripts/find-block-for-date.js diff --git a/package-lock.json b/package-lock.json index cb6a7d0..40c384f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3620,6 +3620,15 @@ } } }, + "ethereum-block-by-date": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ethereum-block-by-date/-/ethereum-block-by-date-1.4.0.tgz", + "integrity": "sha512-3D+6esxU9bQDyFev9/9C6+Wqpb+HdSyeKnAhktIZXOQjgPdGRc4zwr/FdrgMfrJlB9Ee4cG9psu7eCgYQ3szaA==", + "dev": true, + "requires": { + "moment": "^2.29.1" + } + }, "ethereum-common": { "version": "0.0.18", "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.18.tgz", @@ -6040,6 +6049,12 @@ "integrity": "sha512-Yp4o3/ZA15wsXqJTT+R+9w2AYIkD1i80Lds47wDbuUhOvQvm+O2EfjFZSz0pMgZZSPHRhGxgcd2+GL4+jZMtdw==", "dev": true }, + "moment": { + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", + "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==", + "dev": true + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -9470,7 +9485,7 @@ "dev": true }, "websocket": { - "version": "github:web3-js/WebSocket-Node#905deb4812572b344f5801f8c9ce8bb02799d82e", + "version": "github:web3-js/WebSocket-Node#ef5ea2f41daf4a2113b80c9223df884b4d56c400", "from": "github:web3-js/WebSocket-Node#polyfill/globalThis", "dev": true, "requires": { @@ -9916,4 +9931,4 @@ } } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 07e8b89..b89c360 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", "eth-provider": "^0.2.5", + "ethereum-block-by-date": "^1.4.0", "homedir": "^0.6.0", "promptly": "^3.0.3", "solc": "^0.6.8", diff --git a/scripts/find-block-for-date.js b/scripts/find-block-for-date.js new file mode 100644 index 0000000..690faa9 --- /dev/null +++ b/scripts/find-block-for-date.js @@ -0,0 +1,19 @@ +const promptly = require('promptly'); +const EthDater = require('ethereum-block-by-date'); +const initKredits = require('./helpers/init_kredits.js'); + +module.exports = async function(callback) { + let kredits; + try { kredits = await initKredits(web3); } catch(e) { callback(e); return; } + + const dater = new EthDater(kredits.provider); + const dateStr = await promptly.prompt('Specify a date and time (e.g. 2021-05-07T14:00:40Z): '); + const blockData = await dater.getDate(dateStr, true); + + console.log(` +The closest block is #${blockData.block}: +https://rinkeby.etherscan.io/block/${blockData.block} +`); + + callback(); +} -- 2.25.1 From 20879c4c082a3143bbfe05cb5a5ee4d3c318d14a Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Mon, 31 May 2021 10:07:44 +0200 Subject: [PATCH 32/32] Add .nvmrc Configures node version to what we currently recommend/require. --- .nvmrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..48082f7 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +12 -- 2.25.1