You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
Is your feature request related to a problem? Please describe.
Using abigen!() releases a contract whose deploy method returns ContractDeployer. When deploying ownable contracts you want to set who you're sending it from, especially if your provider has multiple accounts.
Describe the solution you'd like
Set ContractDeployer's deployer field to public.
pubstructContractDeployer<M,C>{/// the actual deployer, exposed for overriding the defaultspubdeployer:Deployer<M>,// change this/// marker for the `Contract` type to create afterwards////// this type will be used to construct it via `From::from(Contract)`_contract:PhantomData<C>,}
abigen!(OwnableContract,"$CARGO_MANIFEST_DIR/artifacts/OwnableContract.sol/OwnableContract.json");let deployer = OwnableContract::deploy(Arc::new(provider.clone()),"".to_string(),).expect("Failed to create deployer");let desired_from_address = provider.getAccounts().await?[0];
deployer.deployer.tx.from = desired_from_address;
deployer.send().await.expect("failed to send");
Describe alternatives you've considered
You could create a SingleSigner middleware and deploy it with it, but you could also expose deployer as public and privatize Deployer's private fields (already being done) and modify the public transaction. (and it's already public for situations like these, was just an oversight not to set ContractDeployer's deployer to public).
Additional context
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Using abigen!() releases a contract whose deploy method returns ContractDeployer. When deploying ownable contracts you want to set who you're sending it from, especially if your provider has multiple accounts.
Describe the solution you'd like
Set ContractDeployer's deployer field to public.
Describe alternatives you've considered
You could create a SingleSigner middleware and deploy it with it, but you could also expose deployer as public and privatize Deployer's private fields (already being done) and modify the public transaction. (and it's already public for situations like these, was just an oversight not to set ContractDeployer's deployer to public).
Additional context
![image](https://user-images.githubusercontent.com/83731823/163961845-a4b3fed4-df72-4d1b-b293-97dc07d3b9b7.png)
The text was updated successfully, but these errors were encountered: