-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update oval node to support oval factory deployments #83
Merged
Merged
Changes from 18 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
977b422
feat: oval multi unlocker
md0x 588cd5d
feat: add contract types
md0x 7efa89d
feat: change structure and signatures
md0x ddfd91e
feat: comments and env var
md0x 87bac83
feat: ci tests
md0x b3731f7
feat: fix tests
md0x cb52562
feat: fix tests bis
md0x 9a5c3e2
fix: tests ci
md0x c092f09
fix: tests ci pkeys
md0x de05da5
feat: simplify
md0x ba6590b
feat: remove dep
md0x c33b1de
feat: init configs
md0x d66cad8
feat: remove extra type
md0x 0aa2f98
feat: clean tests
md0x 4131b76
feat: oval discovery
md0x 9dfd12e
feat: oval discovery improvements
md0x 9783f18
feat: simplify call
md0x 7d2017b
feat: improve oval discovery initialization
md0x 28ba4fc
feat: data structure wallet manager
md0x 8773050
feat: improve wallet manager selection criteria
md0x 6654052
feat: add log to notify if key used multiple times
md0x 31d21c5
feat: tests use public getWallet
md0x 69b24fb
feat: encode unlock for Permission Proxy
md0x 79fd454
feat: check that sender is correct
md0x 8ab9061
feat: update permission call
md0x f2fb908
feat: refine comments
md0x 6bb034a
fix: stub permission proxy call
md0x 34679cb
feat: readme
md0x d814d73
feat: rename function and comments
md0x 5c77377
feat: add try catch
md0x fee339d
feat: simplify factory update logic
md0x 54d3ed1
Merge branch 'development' into pablo/oval-shared-unlockers
md0x 9ef3966
feat: remove contract types
md0x 5a1c469
feat: ignore contract types
md0x fe07a88
feat: oval abi
md0x 35bf78e
feat: oval discovery warm up log
md0x File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: "CI" | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- "master" | ||
|
||
jobs: | ||
test: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: "Check out the repo" | ||
uses: "actions/checkout@v4" | ||
|
||
- name: "Install Node.js" | ||
uses: "actions/setup-node@v3" | ||
with: | ||
node-version: "20" | ||
|
||
- name: "Install Yarn" | ||
run: "npm install --global yarn" | ||
|
||
- name: "Install Node.js dependencies" | ||
run: "yarn install" | ||
|
||
- name: "Create .env file" | ||
run: | | ||
echo 'PROVIDER_URL="https://mainnet.infura.io/v3/00000000000000000000000000000000"' > .env | ||
echo 'PROVIDER_WSS="wss://mainnet.infura.io/ws/v3/00000000000000000000000000000000"' >> .env | ||
echo 'FORWARD_URL="https://relay.flashbots.net"' >> .env | ||
echo 'OVAL_CONFIGS="{"0x000000000000000000000000000000000000beef":{"unlockerKey":"0x000000000000000000000000000000000000000000000000000000000000beef","refundAddress":"0x000000000000000000000000000000000000beef","refundPercent":90}}"' >> .env | ||
echo 'AUTH_PRIVATE_KEY="0x0000000000000000000000000000000000000000000000000000000000000000"' >> .env | ||
echo 'MAINNET_BLOCK_OFFSET=5' >> .env | ||
|
||
- name: "Run the tests" | ||
run: "yarn test" | ||
|
||
- name: "Add test summary" | ||
run: | | ||
echo "## Tests result" >> $GITHUB_STEP_SUMMARY | ||
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY |
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,11 @@ | ||
{ | ||
"require": "ts-node/register", | ||
"extension": [ | ||
"ts" | ||
], | ||
"spec": "test/**/*.ts", | ||
"watch-files": [ | ||
"src/**/*.ts", | ||
"test/**/*.ts" | ||
] | ||
} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,249 @@ | ||
/* Autogenerated file. Do not edit manually. */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
import type { | ||
BaseContract, | ||
BytesLike, | ||
FunctionFragment, | ||
Result, | ||
Interface, | ||
EventFragment, | ||
AddressLike, | ||
ContractRunner, | ||
ContractMethod, | ||
Listener, | ||
} from "ethers"; | ||
import type { | ||
TypedContractEvent, | ||
TypedDeferredTopicFilter, | ||
TypedEventLog, | ||
TypedLogDescription, | ||
TypedListener, | ||
TypedContractMethod, | ||
} from "./common"; | ||
|
||
export interface PermissionProxyInterface extends Interface { | ||
getFunction( | ||
nameOrSignature: | ||
| "execute" | ||
| "multicall" | ||
| "owner" | ||
| "renounceOwnership" | ||
| "senders" | ||
| "setSender" | ||
| "transferOwnership" | ||
): FunctionFragment; | ||
|
||
getEvent( | ||
nameOrSignatureOrTopic: "OwnershipTransferred" | "SenderSet" | ||
): EventFragment; | ||
|
||
encodeFunctionData( | ||
functionFragment: "execute", | ||
values: [AddressLike, BytesLike] | ||
): string; | ||
encodeFunctionData( | ||
functionFragment: "multicall", | ||
values: [BytesLike[]] | ||
): string; | ||
encodeFunctionData(functionFragment: "owner", values?: undefined): string; | ||
encodeFunctionData( | ||
functionFragment: "renounceOwnership", | ||
values?: undefined | ||
): string; | ||
encodeFunctionData( | ||
functionFragment: "senders", | ||
values: [AddressLike] | ||
): string; | ||
encodeFunctionData( | ||
functionFragment: "setSender", | ||
values: [AddressLike, boolean] | ||
): string; | ||
encodeFunctionData( | ||
functionFragment: "transferOwnership", | ||
values: [AddressLike] | ||
): string; | ||
|
||
decodeFunctionResult(functionFragment: "execute", data: BytesLike): Result; | ||
decodeFunctionResult(functionFragment: "multicall", data: BytesLike): Result; | ||
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; | ||
decodeFunctionResult( | ||
functionFragment: "renounceOwnership", | ||
data: BytesLike | ||
): Result; | ||
decodeFunctionResult(functionFragment: "senders", data: BytesLike): Result; | ||
decodeFunctionResult(functionFragment: "setSender", data: BytesLike): Result; | ||
decodeFunctionResult( | ||
functionFragment: "transferOwnership", | ||
data: BytesLike | ||
): Result; | ||
} | ||
|
||
export namespace OwnershipTransferredEvent { | ||
export type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike]; | ||
export type OutputTuple = [previousOwner: string, newOwner: string]; | ||
export interface OutputObject { | ||
previousOwner: string; | ||
newOwner: string; | ||
} | ||
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; | ||
export type Filter = TypedDeferredTopicFilter<Event>; | ||
export type Log = TypedEventLog<Event>; | ||
export type LogDescription = TypedLogDescription<Event>; | ||
} | ||
|
||
export namespace SenderSetEvent { | ||
export type InputTuple = [sender: AddressLike, allowed: boolean]; | ||
export type OutputTuple = [sender: string, allowed: boolean]; | ||
export interface OutputObject { | ||
sender: string; | ||
allowed: boolean; | ||
} | ||
export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; | ||
export type Filter = TypedDeferredTopicFilter<Event>; | ||
export type Log = TypedEventLog<Event>; | ||
export type LogDescription = TypedLogDescription<Event>; | ||
} | ||
|
||
export interface PermissionProxy extends BaseContract { | ||
connect(runner?: ContractRunner | null): PermissionProxy; | ||
waitForDeployment(): Promise<this>; | ||
|
||
interface: PermissionProxyInterface; | ||
|
||
queryFilter<TCEvent extends TypedContractEvent>( | ||
event: TCEvent, | ||
fromBlockOrBlockhash?: string | number | undefined, | ||
toBlock?: string | number | undefined | ||
): Promise<Array<TypedEventLog<TCEvent>>>; | ||
queryFilter<TCEvent extends TypedContractEvent>( | ||
filter: TypedDeferredTopicFilter<TCEvent>, | ||
fromBlockOrBlockhash?: string | number | undefined, | ||
toBlock?: string | number | undefined | ||
): Promise<Array<TypedEventLog<TCEvent>>>; | ||
|
||
on<TCEvent extends TypedContractEvent>( | ||
event: TCEvent, | ||
listener: TypedListener<TCEvent> | ||
): Promise<this>; | ||
on<TCEvent extends TypedContractEvent>( | ||
filter: TypedDeferredTopicFilter<TCEvent>, | ||
listener: TypedListener<TCEvent> | ||
): Promise<this>; | ||
|
||
once<TCEvent extends TypedContractEvent>( | ||
event: TCEvent, | ||
listener: TypedListener<TCEvent> | ||
): Promise<this>; | ||
once<TCEvent extends TypedContractEvent>( | ||
filter: TypedDeferredTopicFilter<TCEvent>, | ||
listener: TypedListener<TCEvent> | ||
): Promise<this>; | ||
|
||
listeners<TCEvent extends TypedContractEvent>( | ||
event: TCEvent | ||
): Promise<Array<TypedListener<TCEvent>>>; | ||
listeners(eventName?: string): Promise<Array<Listener>>; | ||
removeAllListeners<TCEvent extends TypedContractEvent>( | ||
event?: TCEvent | ||
): Promise<this>; | ||
|
||
execute: TypedContractMethod< | ||
[target: AddressLike, callData: BytesLike], | ||
[string], | ||
"nonpayable" | ||
>; | ||
|
||
multicall: TypedContractMethod<[data: BytesLike[]], [string[]], "nonpayable">; | ||
|
||
owner: TypedContractMethod<[], [string], "view">; | ||
|
||
renounceOwnership: TypedContractMethod<[], [void], "nonpayable">; | ||
|
||
senders: TypedContractMethod<[arg0: AddressLike], [boolean], "view">; | ||
|
||
setSender: TypedContractMethod< | ||
[sender: AddressLike, allowed: boolean], | ||
[void], | ||
"nonpayable" | ||
>; | ||
|
||
transferOwnership: TypedContractMethod< | ||
[newOwner: AddressLike], | ||
[void], | ||
"nonpayable" | ||
>; | ||
|
||
getFunction<T extends ContractMethod = ContractMethod>( | ||
key: string | FunctionFragment | ||
): T; | ||
|
||
getFunction( | ||
nameOrSignature: "execute" | ||
): TypedContractMethod< | ||
[target: AddressLike, callData: BytesLike], | ||
[string], | ||
"nonpayable" | ||
>; | ||
getFunction( | ||
nameOrSignature: "multicall" | ||
): TypedContractMethod<[data: BytesLike[]], [string[]], "nonpayable">; | ||
getFunction( | ||
nameOrSignature: "owner" | ||
): TypedContractMethod<[], [string], "view">; | ||
getFunction( | ||
nameOrSignature: "renounceOwnership" | ||
): TypedContractMethod<[], [void], "nonpayable">; | ||
getFunction( | ||
nameOrSignature: "senders" | ||
): TypedContractMethod<[arg0: AddressLike], [boolean], "view">; | ||
getFunction( | ||
nameOrSignature: "setSender" | ||
): TypedContractMethod< | ||
[sender: AddressLike, allowed: boolean], | ||
[void], | ||
"nonpayable" | ||
>; | ||
getFunction( | ||
nameOrSignature: "transferOwnership" | ||
): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">; | ||
|
||
getEvent( | ||
key: "OwnershipTransferred" | ||
): TypedContractEvent< | ||
OwnershipTransferredEvent.InputTuple, | ||
OwnershipTransferredEvent.OutputTuple, | ||
OwnershipTransferredEvent.OutputObject | ||
>; | ||
getEvent( | ||
key: "SenderSet" | ||
): TypedContractEvent< | ||
SenderSetEvent.InputTuple, | ||
SenderSetEvent.OutputTuple, | ||
SenderSetEvent.OutputObject | ||
>; | ||
|
||
filters: { | ||
"OwnershipTransferred(address,address)": TypedContractEvent< | ||
OwnershipTransferredEvent.InputTuple, | ||
OwnershipTransferredEvent.OutputTuple, | ||
OwnershipTransferredEvent.OutputObject | ||
>; | ||
OwnershipTransferred: TypedContractEvent< | ||
OwnershipTransferredEvent.InputTuple, | ||
OwnershipTransferredEvent.OutputTuple, | ||
OwnershipTransferredEvent.OutputObject | ||
>; | ||
|
||
"SenderSet(address,bool)": TypedContractEvent< | ||
SenderSetEvent.InputTuple, | ||
SenderSetEvent.OutputTuple, | ||
SenderSetEvent.OutputObject | ||
>; | ||
SenderSet: TypedContractEvent< | ||
SenderSetEvent.InputTuple, | ||
SenderSetEvent.OutputTuple, | ||
SenderSetEvent.OutputObject | ||
>; | ||
}; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't these be gitignored and generated as part of build?
Also, for the sake of consistency, maybe we can also add Oval abi to this flow (currently its abi is in ts)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup