Skip to content

Commit

Permalink
Hanan/create split (#57)
Browse files Browse the repository at this point in the history
* createObolRewardSplit main helpers

* clean the createObolRewardSplit

* define chain constants

* unit tests

* fix prettier

* add ajv

* add ajv

* fix test

* add private key secret  to yaml

* lint and prettier last for now only

* lint fixes

* fix docs

* reflect review comments

* fix tests

* add more tests

* remove logs

* fix yaml error

* fix lint issues

* use ZeroAddress from ethers

* reflect feedback

* address review comments

* fix lint issues
  • Loading branch information
HananINouman authored Sep 11, 2024
1 parent 8742f59 commit e5935d9
Show file tree
Hide file tree
Showing 21 changed files with 3,154 additions and 623 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ module.exports = {
'@typescript-eslint/member-delimiter-style': 'off',
'no-useless-catch': 0,
'new-cap': 0,
"@typescript-eslint/naming-convention": 'off'
},
};
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ jobs:

- name: Run e2e tests
working-directory: ./test/sdk-package-test
run: yarn run test:e2e
run: yarn run test:e2e
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ dist

.DS_Store

.env

145 changes: 145 additions & 0 deletions src/abi/Multicall.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
export const MultiCallContract = {
abi: [
{
constant: true,
inputs: [],
name: 'getCurrentBlockTimestamp',
outputs: [
{
name: 'timestamp',
type: 'uint256',
},
],
payable: false,
stateMutability: 'view',
type: 'function',
},
{
constant: false,
inputs: [
{
components: [
{
name: 'target',
type: 'address',
},
{
name: 'callData',
type: 'bytes',
},
],
name: 'calls',
type: 'tuple[]',
},
],
name: 'aggregate',
outputs: [
{
name: 'blockNumber',
type: 'uint256',
},
{
name: 'returnData',
type: 'bytes[]',
},
],
payable: false,
stateMutability: 'nonpayable',
type: 'function',
},
{
constant: true,
inputs: [],
name: 'getLastBlockHash',
outputs: [
{
name: 'blockHash',
type: 'bytes32',
},
],
payable: false,
stateMutability: 'view',
type: 'function',
},
{
constant: true,
inputs: [
{
name: 'addr',
type: 'address',
},
],
name: 'getEthBalance',
outputs: [
{
name: 'balance',
type: 'uint256',
},
],
payable: false,
stateMutability: 'view',
type: 'function',
},
{
constant: true,
inputs: [],
name: 'getCurrentBlockDifficulty',
outputs: [
{
name: 'difficulty',
type: 'uint256',
},
],
payable: false,
stateMutability: 'view',
type: 'function',
},
{
constant: true,
inputs: [],
name: 'getCurrentBlockGasLimit',
outputs: [
{
name: 'gaslimit',
type: 'uint256',
},
],
payable: false,
stateMutability: 'view',
type: 'function',
},
{
constant: true,
inputs: [],
name: 'getCurrentBlockCoinbase',
outputs: [
{
name: 'coinbase',
type: 'address',
},
],
payable: false,
stateMutability: 'view',
type: 'function',
},
{
constant: true,
inputs: [
{
name: 'blockNumber',
type: 'uint256',
},
],
name: 'getBlockHash',
outputs: [
{
name: 'blockHash',
type: 'bytes32',
},
],
payable: false,
stateMutability: 'view',
type: 'function',
},
],
};
130 changes: 130 additions & 0 deletions src/abi/OWR.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
export const OWRFactoryContract = {
abi: [
{
inputs: [
{
internalType: 'string',
name: '_ensName',
type: 'string',
},
{
internalType: 'address',
name: '_ensReverseRegistrar',
type: 'address',
},
{
internalType: 'address',
name: '_ensOwner',
type: 'address',
},
],
stateMutability: 'nonpayable',
type: 'constructor',
},
{
inputs: [],
name: 'Invalid__Recipients',
type: 'error',
},
{
inputs: [
{
internalType: 'uint256',
name: 'threshold',
type: 'uint256',
},
],
name: 'Invalid__ThresholdTooLarge',
type: 'error',
},
{
inputs: [],
name: 'Invalid__ZeroThreshold',
type: 'error',
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: 'address',
name: 'owr',
type: 'address',
},
{
indexed: false,
internalType: 'address',
name: 'recoveryAddress',
type: 'address',
},
{
indexed: false,
internalType: 'address',
name: 'principalRecipient',
type: 'address',
},
{
indexed: false,
internalType: 'address',
name: 'rewardRecipient',
type: 'address',
},
{
indexed: false,
internalType: 'uint256',
name: 'threshold',
type: 'uint256',
},
],
name: 'CreateOWRecipient',
type: 'event',
},
{
inputs: [
{
internalType: 'address',
name: 'recoveryAddress',
type: 'address',
},
{
internalType: 'address',
name: 'principalRecipient',
type: 'address',
},
{
internalType: 'address',
name: 'rewardRecipient',
type: 'address',
},
{
internalType: 'uint256',
name: 'amountOfPrincipalStake',
type: 'uint256',
},
],
name: 'createOWRecipient',
outputs: [
{
internalType: 'contract OptimisticWithdrawalRecipient',
name: 'owr',
type: 'address',
},
],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [],
name: 'owrImpl',
outputs: [
{
internalType: 'contract OptimisticWithdrawalRecipient',
name: '',
type: 'address',
},
],
stateMutability: 'view',
type: 'function',
},
],
};
Loading

0 comments on commit e5935d9

Please sign in to comment.