From 1a2a1f42320b1ed7921ce764477e16c43e6fae34 Mon Sep 17 00:00:00 2001 From: Mohammed Sohail Date: Sat, 5 Oct 2024 12:19:49 +0300 Subject: [PATCH] feat: remove voucher mints --- .../data/CustodialRegistrationProxy.bin | 9 +- .../data/CustodialRegistrationProxy.json | 167 +----------------- .../CustodialRegistrationProxy.metadata.json | 9 + solidity/CustodialRegistrationProxy.sol | 39 ++-- solidity/Makefile | 13 ++ 5 files changed, 53 insertions(+), 184 deletions(-) create mode 100644 custodial_registration_proxy/data/CustodialRegistrationProxy.metadata.json create mode 100644 solidity/Makefile diff --git a/custodial_registration_proxy/data/CustodialRegistrationProxy.bin b/custodial_registration_proxy/data/CustodialRegistrationProxy.bin index 89c0235..73ead34 100644 --- a/custodial_registration_proxy/data/CustodialRegistrationProxy.bin +++ b/custodial_registration_proxy/data/CustodialRegistrationProxy.bin @@ -1 +1,8 @@ -608060405234801561001057600080fd5b50604051610bc6380380610bc6833981810160405281019061003291906101e2565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050610249565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006101af82610184565b9050919050565b6101bf816101a4565b81146101ca57600080fd5b50565b6000815190506101dc816101b6565b92915050565b600080600080608085870312156101fc576101fb61017f565b5b600061020a878288016101cd565b945050602061021b878288016101cd565b935050604061022c878288016101cd565b925050606061023d878288016101cd565b91505092959194509250565b61096e806102586000396000f3fe608060405234801561001057600080fd5b50600436106100925760003560e01c80638da5cb5b116100665780638da5cb5b1461010d578063b2f5ae4b1461012b578063becf2e3614610149578063e2af398014610165578063f5a1f5b41461018357610092565b80628c03371461009757806317603379146100b557806329db660b146100d35780634420e486146100f1575b600080fd5b61009f61019f565b6040516100ac91906106f0565b60405180910390f35b6100bd6101c5565b6040516100ca919061072c565b60405180910390f35b6100db6101eb565b6040516100e89190610768565b60405180910390f35b61010b600480360381019061010691906107c6565b610211565b005b6101156104e9565b6040516101229190610802565b60405180910390f35b61013361050d565b6040516101409190610836565b60405180910390f35b610163600480360381019061015e91906107c6565b610514565b005b61016d6105b0565b60405161017a9190610802565b60405180910390f35b61019d600480360381019061019891906107c6565b6105d6565b005b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806102b85750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6102c157600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630a3b0a4f826040518263ffffffff1660e01b815260040161031c9190610802565b6020604051808303816000875af115801561033b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061035f9190610889565b50600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166363e4bff4826040518263ffffffff1660e01b81526004016103bb9190610802565b6020604051808303816000875af11580156103da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103fe91906108e2565b50600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663449a52f882624c4b406040518363ffffffff1660e01b815260040161045f92919061090f565b6020604051808303816000875af115801561047e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a29190610889565b508073ffffffffffffffffffffffffffffffffffffffff167f894e56e1dac400b4475c83d8af0f0aa44de17c62764bd82f6e768a504e24246160405160405180910390a250565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b624c4b4081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461056c57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461062e57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006106b66106b16106ac84610671565b610691565b610671565b9050919050565b60006106c88261069b565b9050919050565b60006106da826106bd565b9050919050565b6106ea816106cf565b82525050565b600060208201905061070560008301846106e1565b92915050565b6000610716826106bd565b9050919050565b6107268161070b565b82525050565b6000602082019050610741600083018461071d565b92915050565b6000610752826106bd565b9050919050565b61076281610747565b82525050565b600060208201905061077d6000830184610759565b92915050565b600080fd5b600061079382610671565b9050919050565b6107a381610788565b81146107ae57600080fd5b50565b6000813590506107c08161079a565b92915050565b6000602082840312156107dc576107db610783565b5b60006107ea848285016107b1565b91505092915050565b6107fc81610788565b82525050565b600060208201905061081760008301846107f3565b92915050565b6000819050919050565b6108308161081d565b82525050565b600060208201905061084b6000830184610827565b92915050565b60008115159050919050565b61086681610851565b811461087157600080fd5b50565b6000815190506108838161085d565b92915050565b60006020828403121561089f5761089e610783565b5b60006108ad84828501610874565b91505092915050565b6108bf8161081d565b81146108ca57600080fd5b50565b6000815190506108dc816108b6565b92915050565b6000602082840312156108f8576108f7610783565b5b6000610906848285016108cd565b91505092915050565b600060408201905061092460008301856107f3565b6109316020830184610827565b939250505056fea26469706673582212208d47e88f7e43dc1b1c83fcc7b51830923b6ddc341b7d56b35fd1755648f3520764736f6c63430008130033 \ No newline at end of file +608060405234801561001057600080fd5b506040516109bf3803806109bf833981810160405281019061003291906101a0565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050506101f3565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061016d82610142565b9050919050565b61017d81610162565b811461018857600080fd5b50565b60008151905061019a81610174565b92915050565b6000806000606084860312156101b9576101b861013d565b5b60006101c78682870161018b565b93505060206101d88682870161018b565b92505060406101e98682870161018b565b9150509250925092565b6107bd806102026000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80638da5cb5b1161005b5780638da5cb5b146100da578063becf2e36146100f8578063e2af398014610114578063f5a1f5b4146101325761007d565b8063176033791461008257806329db660b146100a05780634420e486146100be575b600080fd5b61008a61014e565b60405161009791906105ce565b60405180910390f35b6100a8610174565b6040516100b5919061060a565b60405180910390f35b6100d860048036038101906100d39190610668565b61019a565b005b6100e26103ce565b6040516100ef91906106a4565b60405180910390f35b610112600480360381019061010d9190610668565b6103f2565b005b61011c61048e565b60405161012991906106a4565b60405180910390f35b61014c60048036038101906101479190610668565b6104b4565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806102415750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61024a57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630a3b0a4f826040518263ffffffff1660e01b81526004016102a591906106a4565b6020604051808303816000875af11580156102c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102e891906106f7565b50600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166363e4bff4826040518263ffffffff1660e01b815260040161034491906106a4565b6020604051808303816000875af1158015610363573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610387919061075a565b508073ffffffffffffffffffffffffffffffffffffffff167f894e56e1dac400b4475c83d8af0f0aa44de17c62764bd82f6e768a504e24246160405160405180910390a250565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461044a57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461050c57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061059461058f61058a8461054f565b61056f565b61054f565b9050919050565b60006105a682610579565b9050919050565b60006105b88261059b565b9050919050565b6105c8816105ad565b82525050565b60006020820190506105e360008301846105bf565b92915050565b60006105f48261059b565b9050919050565b610604816105e9565b82525050565b600060208201905061061f60008301846105fb565b92915050565b600080fd5b60006106358261054f565b9050919050565b6106458161062a565b811461065057600080fd5b50565b6000813590506106628161063c565b92915050565b60006020828403121561067e5761067d610625565b5b600061068c84828501610653565b91505092915050565b61069e8161062a565b82525050565b60006020820190506106b96000830184610695565b92915050565b60008115159050919050565b6106d4816106bf565b81146106df57600080fd5b50565b6000815190506106f1816106cb565b92915050565b60006020828403121561070d5761070c610625565b5b600061071b848285016106e2565b91505092915050565b6000819050919050565b61073781610724565b811461074257600080fd5b50565b6000815190506107548161072e565b92915050565b6000602082840312156107705761076f610625565b5b600061077e84828501610745565b9150509291505056fea264697066735822122066f8b2ff622cb5e90e41ce99babbe8c86d5b71c10c9933e8a3150aa8332cf60a64736f6c63430008190033 + +======= CustodialRegistrationProxy.sol:ICustodialAccountIndex ======= +Binary: + + +======= CustodialRegistrationProxy.sol:IEthFaucet ======= +Binary: diff --git a/custodial_registration_proxy/data/CustodialRegistrationProxy.json b/custodial_registration_proxy/data/CustodialRegistrationProxy.json index 0de0442..0427199 100644 --- a/custodial_registration_proxy/data/CustodialRegistrationProxy.json +++ b/custodial_registration_proxy/data/CustodialRegistrationProxy.json @@ -1,158 +1,9 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "_ethFaucetAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "_custodialAccountIndexAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "_trainingVoucherAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "_systemAccount", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "subject", - "type": "address" - } - ], - "name": "NewRegistration", - "type": "event" - }, - { - "inputs": [], - "name": "CustodialAccountIndex", - "outputs": [ - { - "internalType": "contract ICustodialAccountIndex", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "EthFaucet", - "outputs": [ - { - "internalType": "contract IEthFaucet", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "TrainingVoucher", - "outputs": [ - { - "internalType": "contract IDemurrageTokenSingleNocap", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_subject", - "type": "address" - } - ], - "name": "register", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_newOwner", - "type": "address" - } - ], - "name": "setNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_newSystemAccount", - "type": "address" - } - ], - "name": "setNewSystemAccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "systemAccount", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "trainingVoucerGiftAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } -] \ No newline at end of file +[{"inputs":[{"internalType":"address","name":"_ethFaucetAddress","type":"address"},{"internalType":"address","name":"_custodialAccountIndexAddress","type":"address"},{"internalType":"address","name":"_systemAccount","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"subject","type":"address"}],"name":"NewRegistration","type":"event"},{"inputs":[],"name":"CustodialAccountIndex","outputs":[{"internalType":"contract ICustodialAccountIndex","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EthFaucet","outputs":[{"internalType":"contract IEthFaucet","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"register","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"setNewOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newSystemAccount","type":"address"}],"name":"setNewSystemAccount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"systemAccount","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}] + +======= CustodialRegistrationProxy.sol:ICustodialAccountIndex ======= +Contract JSON ABI +[{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"add","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}] + +======= CustodialRegistrationProxy.sol:IEthFaucet ======= +Contract JSON ABI +[{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"giveTo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}] diff --git a/custodial_registration_proxy/data/CustodialRegistrationProxy.metadata.json b/custodial_registration_proxy/data/CustodialRegistrationProxy.metadata.json new file mode 100644 index 0000000..ab8bdce --- /dev/null +++ b/custodial_registration_proxy/data/CustodialRegistrationProxy.metadata.json @@ -0,0 +1,9 @@ +{"compiler":{"version":"0.8.25+commit.b61c2a91"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"address","name":"_ethFaucetAddress","type":"address"},{"internalType":"address","name":"_custodialAccountIndexAddress","type":"address"},{"internalType":"address","name":"_systemAccount","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"subject","type":"address"}],"name":"NewRegistration","type":"event"},{"inputs":[],"name":"CustodialAccountIndex","outputs":[{"internalType":"contract ICustodialAccountIndex","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EthFaucet","outputs":[{"internalType":"contract IEthFaucet","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_subject","type":"address"}],"name":"register","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"setNewOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newSystemAccount","type":"address"}],"name":"setNewSystemAccount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"systemAccount","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"CustodialRegistrationProxy.sol":"CustodialRegistrationProxy"},"evmVersion":"istanbul","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"CustodialRegistrationProxy.sol":{"keccak256":"0xacb61043b4295ad2d8fc280cb2550fce2f5206e5144f96ee90f1be77c1a537bf","license":"AGPL-3.0-or-later","urls":["bzz-raw://169e16afeb5824560c80949f77f8d08c802e26591797c6c3d1d2fb11b1fe7ebb","dweb:/ipfs/QmTFTUAsuuqxWnJJjxaDzFhXy3wGuBVyAuPjSgcN497hyy"]}},"version":1} + +======= CustodialRegistrationProxy.sol:ICustodialAccountIndex ======= +Metadata: +{"compiler":{"version":"0.8.25+commit.b61c2a91"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"add","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"CustodialRegistrationProxy.sol":"ICustodialAccountIndex"},"evmVersion":"istanbul","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"CustodialRegistrationProxy.sol":{"keccak256":"0xacb61043b4295ad2d8fc280cb2550fce2f5206e5144f96ee90f1be77c1a537bf","license":"AGPL-3.0-or-later","urls":["bzz-raw://169e16afeb5824560c80949f77f8d08c802e26591797c6c3d1d2fb11b1fe7ebb","dweb:/ipfs/QmTFTUAsuuqxWnJJjxaDzFhXy3wGuBVyAuPjSgcN497hyy"]}},"version":1} + +======= CustodialRegistrationProxy.sol:IEthFaucet ======= +Metadata: +{"compiler":{"version":"0.8.25+commit.b61c2a91"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"giveTo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"CustodialRegistrationProxy.sol":"IEthFaucet"},"evmVersion":"istanbul","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"CustodialRegistrationProxy.sol":{"keccak256":"0xacb61043b4295ad2d8fc280cb2550fce2f5206e5144f96ee90f1be77c1a537bf","license":"AGPL-3.0-or-later","urls":["bzz-raw://169e16afeb5824560c80949f77f8d08c802e26591797c6c3d1d2fb11b1fe7ebb","dweb:/ipfs/QmTFTUAsuuqxWnJJjxaDzFhXy3wGuBVyAuPjSgcN497hyy"]}},"version":1} diff --git a/solidity/CustodialRegistrationProxy.sol b/solidity/CustodialRegistrationProxy.sol index 7d4bfa4..06fdad5 100644 --- a/solidity/CustodialRegistrationProxy.sol +++ b/solidity/CustodialRegistrationProxy.sol @@ -1,26 +1,20 @@ // SPDX-License-Identifier: AGPL-3.0-or-later -pragma solidity >= 0.8.19; +pragma solidity >=0.8.19; interface IEthFaucet { - function giveTo(address _recipient) external returns(uint256); + function giveTo(address _recipient) external returns (uint256); } interface ICustodialAccountIndex { function add(address _account) external returns (bool); } -interface IDemurrageTokenSingleNocap { - function mintTo(address _beneficiary, uint256 _amount) external returns (bool); -} - contract CustodialRegistrationProxy { address public owner; address public systemAccount; - uint256 public constant trainingVoucerGiftAmount = 5000000; IEthFaucet public EthFaucet; ICustodialAccountIndex public CustodialAccountIndex; - IDemurrageTokenSingleNocap public TrainingVoucher; event NewRegistration(address indexed subject); @@ -34,36 +28,31 @@ contract CustodialRegistrationProxy { _; } - constructor(address _ethFaucetAddress, address _custodialAccountIndexAddress, address _trainingVoucherAddress, address _systemAccount) { + constructor( + address _ethFaucetAddress, + address _custodialAccountIndexAddress, + address _systemAccount + ) { owner = msg.sender; systemAccount = _systemAccount; EthFaucet = IEthFaucet(_ethFaucetAddress); - CustodialAccountIndex = ICustodialAccountIndex(_custodialAccountIndexAddress); - TrainingVoucher = IDemurrageTokenSingleNocap(_trainingVoucherAddress); + CustodialAccountIndex = ICustodialAccountIndex( + _custodialAccountIndexAddress + ); } - function setNewOwner(address _newOwner) - public - ownerOnly - { + function setNewOwner(address _newOwner) public ownerOnly { owner = _newOwner; } - function setNewSystemAccount(address _newSystemAccount) - public - ownerOnly - { + function setNewSystemAccount(address _newSystemAccount) public ownerOnly { systemAccount = _newSystemAccount; } - function register(address _subject) - public - systemAccountOnly - { + function register(address _subject) public systemAccountOnly { CustodialAccountIndex.add(_subject); EthFaucet.giveTo(_subject); - TrainingVoucher.mintTo(_subject, trainingVoucerGiftAmount); emit NewRegistration(_subject); } -} \ No newline at end of file +} diff --git a/solidity/Makefile b/solidity/Makefile new file mode 100644 index 0000000..f8297b9 --- /dev/null +++ b/solidity/Makefile @@ -0,0 +1,13 @@ +SOLC = solc + +all: + $(SOLC) CustodialRegistrationProxy.sol --abi --evm-version istanbul | awk 'NR>3' > CustodialRegistrationProxy.json + $(SOLC) CustodialRegistrationProxy.sol --bin --evm-version istanbul | awk 'NR>3' > CustodialRegistrationProxy.bin + $(SOLC) CustodialRegistrationProxy.sol --metadata --evm-version istanbul | awk 'NR>3' > CustodialRegistrationProxy.metadata.json + truncate -s -1 CustodialRegistrationProxy.bin + +install: all + cp -v *.json ../custodial_registration_proxy/data/ + cp -v *.bin ../custodial_registration_proxy/data/ + +.PHONY: install \ No newline at end of file