-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add custodialregistrationproxy
- Loading branch information
1 parent
b47af43
commit 67819d3
Showing
6 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
608060405234801561001057600080fd5b50604051610bc6380380610bc6833981810160405281019061003291906101e2565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050610249565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006101af82610184565b9050919050565b6101bf816101a4565b81146101ca57600080fd5b50565b6000815190506101dc816101b6565b92915050565b600080600080608085870312156101fc576101fb61017f565b5b600061020a878288016101cd565b945050602061021b878288016101cd565b935050604061022c878288016101cd565b925050606061023d878288016101cd565b91505092959194509250565b61096e806102586000396000f3fe608060405234801561001057600080fd5b50600436106100925760003560e01c80638da5cb5b116100665780638da5cb5b1461010d578063b2f5ae4b1461012b578063becf2e3614610149578063e2af398014610165578063f5a1f5b41461018357610092565b80628c03371461009757806317603379146100b557806329db660b146100d35780634420e486146100f1575b600080fd5b61009f61019f565b6040516100ac91906106f0565b60405180910390f35b6100bd6101c5565b6040516100ca919061072c565b60405180910390f35b6100db6101eb565b6040516100e89190610768565b60405180910390f35b61010b600480360381019061010691906107c6565b610211565b005b6101156104e9565b6040516101229190610802565b60405180910390f35b61013361050d565b6040516101409190610836565b60405180910390f35b610163600480360381019061015e91906107c6565b610514565b005b61016d6105b0565b60405161017a9190610802565b60405180910390f35b61019d600480360381019061019891906107c6565b6105d6565b005b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806102b85750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6102c157600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630a3b0a4f826040518263ffffffff1660e01b815260040161031c9190610802565b6020604051808303816000875af115801561033b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061035f9190610889565b50600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166363e4bff4826040518263ffffffff1660e01b81526004016103bb9190610802565b6020604051808303816000875af11580156103da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103fe91906108e2565b50600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663449a52f882624c4b406040518363ffffffff1660e01b815260040161045f92919061090f565b6020604051808303816000875af115801561047e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a29190610889565b508073ffffffffffffffffffffffffffffffffffffffff167f894e56e1dac400b4475c83d8af0f0aa44de17c62764bd82f6e768a504e24246160405160405180910390a250565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b624c4b4081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461056c57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461062e57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006106b66106b16106ac84610671565b610691565b610671565b9050919050565b60006106c88261069b565b9050919050565b60006106da826106bd565b9050919050565b6106ea816106cf565b82525050565b600060208201905061070560008301846106e1565b92915050565b6000610716826106bd565b9050919050565b6107268161070b565b82525050565b6000602082019050610741600083018461071d565b92915050565b6000610752826106bd565b9050919050565b61076281610747565b82525050565b600060208201905061077d6000830184610759565b92915050565b600080fd5b600061079382610671565b9050919050565b6107a381610788565b81146107ae57600080fd5b50565b6000813590506107c08161079a565b92915050565b6000602082840312156107dc576107db610783565b5b60006107ea848285016107b1565b91505092915050565b6107fc81610788565b82525050565b600060208201905061081760008301846107f3565b92915050565b6000819050919050565b6108308161081d565b82525050565b600060208201905061084b6000830184610827565b92915050565b60008115159050919050565b61086681610851565b811461087157600080fd5b50565b6000815190506108838161085d565b92915050565b60006020828403121561089f5761089e610783565b5b60006108ad84828501610874565b91505092915050565b6108bf8161081d565b81146108ca57600080fd5b50565b6000815190506108dc816108b6565b92915050565b6000602082840312156108f8576108f7610783565b5b6000610906848285016108cd565b91505092915050565b600060408201905061092460008301856107f3565b6109316020830184610827565b939250505056fea26469706673582212204725c97f174fc1591845527548658d0dbd5bc9cd62892c93a8efc607d09c7ad064736f6c63430008190033 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"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"}] |
68 changes: 68 additions & 0 deletions
68
pkg/custodialregistrationproxy/custodialregistrationproxy.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package custodialregistrationproxy | ||
|
||
import ( | ||
_ "embed" | ||
|
||
"github.com/grassrootseconomics/ethutils" | ||
"github.com/grassrootseconomics/ge-publish/pkg/util" | ||
) | ||
|
||
type ( | ||
CustodialRegistrationProxy struct { | ||
Constructor []any | ||
} | ||
) | ||
|
||
const ( | ||
name = "CustodialRegistrationProxy" | ||
version = "v0.1.0" | ||
license = "AGPL-3.0" | ||
source = "https://github.com/grassrootseconomics/custodial-registration-proxy/tree/master/solidity" | ||
solidityVersion = "0.8.25+commit.b61c2a91" | ||
evmFork = "istanbul" | ||
|
||
gasLimit = 2_000_000 | ||
) | ||
|
||
var ( | ||
//go:embed CustodialRegistrationProxy.bin | ||
bin string | ||
//go:embed CustodialRegistrationProxy.json | ||
abi string | ||
) | ||
|
||
func (c *CustodialRegistrationProxy) Name() string { | ||
return name | ||
} | ||
|
||
func (c *CustodialRegistrationProxy) Version() string { | ||
return version | ||
} | ||
|
||
func (c *CustodialRegistrationProxy) License() string { | ||
return license | ||
} | ||
|
||
func (c *CustodialRegistrationProxy) Source() string { | ||
return source | ||
} | ||
|
||
func (c *CustodialRegistrationProxy) SolidityVersion() string { | ||
return solidityVersion | ||
} | ||
|
||
func (c *CustodialRegistrationProxy) EVMFork() string { | ||
return evmFork | ||
} | ||
|
||
func (c *CustodialRegistrationProxy) ConstructorArgs() []string { | ||
return util.DumpConstructorArgs(c.Constructor) | ||
} | ||
|
||
func (c *CustodialRegistrationProxy) Bytecode() ([]byte, error) { | ||
return ethutils.PrepareContractBytecodeData(bin, abi, c.Constructor) | ||
} | ||
|
||
func (c *CustodialRegistrationProxy) MaxGasLimit() uint64 { | ||
return gasLimit | ||
} |