Skip to content

Commit

Permalink
Merge branch 'main' into c_headers
Browse files Browse the repository at this point in the history
  • Loading branch information
rachel-bousfield authored Sep 17, 2023
2 parents 69b668c + 12abe2b commit ac2c3e3
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 28 deletions.
5 changes: 0 additions & 5 deletions .clabot

This file was deleted.

12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Description

Please provide a summary of the changes and any backward incompatibilities.

## Checklist

- [ ] I have documented these changes where necessary.
- [ ] I have read the [DCO][DCO] and ensured that these changes comply.
- [ ] I assign this work under its [open source licensing][terms].

[DCO]: licenses/DCO.txt
[terms]: licenses/COPYRIGHT.md
6 changes: 4 additions & 2 deletions licenses/COPYRIGHT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Copyright 2022-2023 Offchain Labs, Inc.

Copyright assignment is required to contribute to this project.
Copyright assignment and [DCO sign-off](DCO.txt) is required to contribute to this project.

Except as otherwise noted (below and/or in individual files), this project is licensed under the Apache License, Version 2.0 ([`LICENSE-APACHE`](Apache-2.0) or http://www.apache.org/licenses/LICENSE-2.0) or the MIT license, ([`LICENSE-MIT`](MIT) or http://opensource.org/licenses/MIT), at your option.
Except as otherwise noted (below and/or in individual files), this project is licensed under the Apache License, Version 2.0 ([`LICENSE-APACHE`](Apache-2.0) or http://www.apache.org/licenses/LICENSE-2.0) or the MIT license, ([`LICENSE-MIT`](MIT) or http://opensource.org/licenses/MIT), at your option.

Each Stylus logo is a service mark of Offchain Labs (collectively, the "Offchain Labs Trademarks"). Offchain Labs reserves all rights in the Offchain Labs Trademarks and nothing herein or in these licenses should be construed as granting, by implication, estoppel, or otherwise, any license or right to use any of Offchain Labs Trademarks without Offchain Labs' prior written permission in each instance. All goodwill generated from the use of Offchain Labs Trademarks will inure to our exclusive benefit.
34 changes: 34 additions & 0 deletions licenses/DCO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
22 changes: 8 additions & 14 deletions src/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::path::{Path, PathBuf};
use std::str::FromStr;

use ethers::types::{Eip1559TransactionRequest, H160, U256};
use ethers::utils::get_contract_address;
use ethers::utils::{get_contract_address, to_checksum};
use ethers::{
middleware::SignerMiddleware,
providers::{Http, Middleware, Provider},
Expand Down Expand Up @@ -61,11 +61,7 @@ pub async fn deploy(cfg: DeployConfig) -> eyre::Result<()> {

let addr = wallet.address();

println!(
"Deployer address: {}{}",
"0x".grey(),
hex::encode(addr).grey()
);
println!("Deployer address: {}", to_checksum(&addr, None).grey(),);

let nonce = client
.get_transaction_count(addr, None)
Expand Down Expand Up @@ -104,9 +100,9 @@ on the --mode flag under cargo stylus deploy --help"#
let balance = provider.get_balance(addr, None).await?;
if balance == U256::zero() {
bail!(
r#"address 0x{} has 0 balance onchain – please refer to our Quickstart guide for deploying
r#"address {} has 0 balance onchain – please refer to our Quickstart guide for deploying
programs to Stylus chains here https://docs.arbitrum.io/stylus/stylus-quickstart"#,
hex::encode(addr),
to_checksum(&addr, None),
);
}
}
Expand Down Expand Up @@ -134,9 +130,8 @@ programs to Stylus chains here https://docs.arbitrum.io/stylus/stylus-quickstart
println!("");
println!("{}", "====DEPLOYMENT====".grey());
println!(
"Deploying program to address {}{}",
"0x".mint(),
hex::encode(expected_program_addr).mint()
"Deploying program to address {}",
to_checksum(&expected_program_addr, None).mint(),
);
let deployment_calldata = program_deployment_calldata(&deploy_ready_code);

Expand Down Expand Up @@ -170,9 +165,8 @@ programs to Stylus chains here https://docs.arbitrum.io/stylus/stylus-quickstart
.unwrap_or(expected_program_addr);
println!("{}", "====ACTIVATION====".grey());
println!(
"Activating program at address {}{}",
"0x".mint(),
hex::encode(program_addr).mint()
"Activating program at address {}",
to_checksum(&program_addr, None).mint(),
);
let activate_calldata = activation_calldata(&program_addr);

Expand Down
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ async fn main() -> eyre::Result<()> {
if let Err(e) = new::new_stylus_project(&name, minimal) {
println!(
"Could not create new stylus project with name {name}: {}",
e.red()
e.pink()
);
};
}
Expand All @@ -193,21 +193,21 @@ async fn main() -> eyre::Result<()> {
if let Err(e) = export_abi::export_json_abi(release, output) {
println!(
"Could not export Stylus program Solidity ABI as JSON: {}",
e.red()
e.pink()
);
};
} else if let Err(e) = export_abi::export_solidity_abi(release, output) {
println!("Could not export Stylus program Solidity ABI: {}", e.red());
println!("Could not export Stylus program Solidity ABI: {}", e.pink());
}
}
StylusSubcommands::Check(cfg) => {
if let Err(e) = check::run_checks(cfg).await {
println!("Stylus checks failed: {}", e.red());
println!("Stylus checks failed: {}", e.pink());
};
}
StylusSubcommands::Deploy(cfg) => {
if let Err(e) = deploy::deploy(cfg).await {
println!("Deploy / activation command failed: {}", e.red());
println!("Deploy / activation command failed: {}", e.pink());
};
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ where
.map_err(|e| eyre!("could not format effective gas price: {e}"))?;
println!(
"Confirmed {tx_kind} tx {}{}",
"0x".pink(),
hex::encode(tx_hash.as_bytes()).pink(),
"0x".mint(),
hex::encode(tx_hash.as_bytes()).mint(),
);
println!(
"Gas units used {}, effective gas price {} gwei",
Expand Down

0 comments on commit ac2c3e3

Please sign in to comment.