Sitelet https://github.com/alloy-rs/examples/pull/33
Skip to content

feat(contracts): add gas estimation layer example and use recommended layers across examples - #33

Closed
zerosnacks wants to merge 17 commits into
mainfrom
zerosnacks/use-gas-estimation-layer
Closed

zerosnacks wants to merge 17 commits into
mainfrom
zerosnacks/use-gas-estimation-layer

Conversation

@zerosnacks

@zerosnacks zerosnacks commented Mar 27, 2024 •

Copy link
Copy Markdown
Contributor

Closes #12

Blocked by upstream changes to improve API in alloy-rs/alloy#406

Specifically around current handling of from field, missing chain_id field (handled in FillTxLayer) and ordering of layers.

Comment on lines +54 to +57
.map(|mut tx| {
tx.set_chain_id(anvil.chain_id());
tx
})

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Expected as a method directly accessible on contract_builder

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The default case will likely be resolved by the new FillTxLayer proposal: alloy-rs/alloy#374 but generally still a good method to have direct access to I think.

let contract_address =
contract_builder.gas(estimate).gas_price(base_fee).nonce(0).deploy().await?;
let contract_address = contract_builder
.from(alice)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Expected not to be required, should be implicit that alice is the from if set as signer

@zerosnacks zerosnacks changed the title [Feature] Add gas estimation layer example and use recommended layers across examples feat(contracts): add gas estimation layer example and use recommended layers across examples Apr 2, 2024
@zerosnacks zerosnacks removed the blocked label Apr 8, 2024
@zerosnacks

Copy link
Copy Markdown
Contributor Author

Now unblocked: alloy-rs/alloy#406

Will likely require a refactor and reconsideration of proposed changes

@zerosnacks

Copy link
Copy Markdown
Contributor Author

Close in favor of #50

@zerosnacks zerosnacks closed this Apr 9, 2024
@zerosnacks
zerosnacks deleted the zerosnacks/use-gas-estimation-layer branch April 17, 2024 11:03
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.

[Feature] Add GasFiller example to contracts and as gas_filler example in layers

1 participant