Skip to content
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

Create contract utility #14

Merged
merged 15 commits into from
Jan 23, 2024
Merged

Create contract utility #14

merged 15 commits into from
Jan 23, 2024

Conversation

nagdahimanshu
Copy link
Member

@nagdahimanshu nagdahimanshu commented Jan 17, 2024

What was the problem?

This PR resolves #3

How was it solved?

  • Create OracleContract struct with instance of contract
  • Implement functions:
    • GetNextOutputIndex
    • GetL2Output
  • Implement chain_constants with all constants needed
    • Map chainIDs to appropriate contract addresses
    • Added function to get contract addresses by chainID
  • Add tests
    • Contracts.go
    • chain_constants.go

How was it tested?

Local + Tests

@nagdahimanshu nagdahimanshu self-assigned this Jan 17, 2024
@nagdahimanshu nagdahimanshu force-pushed the 3-create-contract-utility branch 2 times, most recently from 1641cf5 to 9f13692 Compare January 17, 2024 17:38
@nagdahimanshu nagdahimanshu force-pushed the 3-create-contract-utility branch from 9f13692 to 58f3a2f Compare January 17, 2024 17:46
@nagdahimanshu nagdahimanshu force-pushed the 3-create-contract-utility branch 2 times, most recently from e68713a to ef11d73 Compare January 18, 2024 09:36
@nagdahimanshu nagdahimanshu force-pushed the 3-create-contract-utility branch from ef11d73 to c9e7f23 Compare January 18, 2024 10:09
@nagdahimanshu nagdahimanshu force-pushed the 3-create-contract-utility branch from c9e7f23 to 34590dd Compare January 18, 2024 11:09
@nagdahimanshu nagdahimanshu force-pushed the 3-create-contract-utility branch 3 times, most recently from 2cc818c to f239011 Compare January 18, 2024 14:58
@nagdahimanshu nagdahimanshu force-pushed the 3-create-contract-utility branch 2 times, most recently from 406735e to 9167799 Compare January 18, 2024 16:07
@nagdahimanshu nagdahimanshu force-pushed the 3-create-contract-utility branch from 9167799 to 7bc4b66 Compare January 18, 2024 16:13
@nagdahimanshu nagdahimanshu changed the base branch from development to main January 18, 2024 16:23
Copy link
Member

@ishantiw ishantiw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, a couple of comments

pkg/chain/contracts.go Outdated Show resolved Hide resolved
pkg/chain/chain_constants.go Outdated Show resolved Hide resolved
pkg/chain/chain_constants.go Show resolved Hide resolved
pkg/chain/chain_constants.go Show resolved Hide resolved
pkg/chain/contracts.go Outdated Show resolved Hide resolved
pkg/chain/contracts.go Outdated Show resolved Hide resolved
pkg/chain/contracts.go Outdated Show resolved Hide resolved
@nagdahimanshu nagdahimanshu marked this pull request as ready for review January 19, 2024 10:33
Copy link
Member

@ishantiw ishantiw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment for contract mapping/finding l2Oracleoutput contract

pkg/chain/chain_constants.go Show resolved Hide resolved
pkg/chain/chain_constants.go Outdated Show resolved Hide resolved
pkg/chain/chain_constants.go Outdated Show resolved Hide resolved
pkg/chain/chain_constants.go Outdated Show resolved Hide resolved
pkg/chain/contracts.go Outdated Show resolved Hide resolved
pkg/chain/contracts.go Show resolved Hide resolved
pkg/chain/contracts.go Show resolved Hide resolved
pkg/chain/contracts.go Show resolved Hide resolved
pkg/chain/contracts.go Outdated Show resolved Hide resolved
pkg/chain/contracts.go Outdated Show resolved Hide resolved
pkg/chain/chain_constants_test.go Outdated Show resolved Hide resolved
pkg/chain/chain_constants.go Outdated Show resolved Hide resolved
pkg/chain/chain_constants.go Outdated Show resolved Hide resolved
pkg/chain/chain_constants.go Outdated Show resolved Hide resolved
pkg/chain/contracts.go Outdated Show resolved Hide resolved
Copy link
Member

@ishantiw ishantiw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from open comments, LGTM

pkg/chain/contracts.go Outdated Show resolved Hide resolved
@nagdahimanshu nagdahimanshu force-pushed the 3-create-contract-utility branch from 3020d21 to cc28034 Compare January 22, 2024 10:24
@nagdahimanshu nagdahimanshu force-pushed the 3-create-contract-utility branch from cc28034 to 26f0f60 Compare January 22, 2024 10:25
Copy link
Member

@ishantiw ishantiw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Copy link
Contributor

@hrmhatef hrmhatef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done.

pkg/chain/contracts.go Outdated Show resolved Hide resolved
pkg/chain/contracts.go Outdated Show resolved Hide resolved
@nagdahimanshu nagdahimanshu requested a review from shuse2 January 22, 2024 23:09
@shuse2 shuse2 merged commit 4dc7463 into main Jan 23, 2024
1 check passed
@shuse2 shuse2 deleted the 3-create-contract-utility branch January 23, 2024 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create contract utility
4 participants