Skip to content

feat(AccountAPI): show deployment address before broadcast #2653

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Aviksaikat
Copy link
Contributor

@Aviksaikat Aviksaikat commented Jul 4, 2025

What I did

fixes: #2596

How I did it

How to verify it

Put the following contract into the contracts folder

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;

contract SimpleContract {
    address public owner;
    constructor() {
        owner = msg.sender;
    }

    function get_value(uint256 value) external view returns(uint){
        return value;
    }
}

Put the following test script in the scripts folder

from ape import project, accounts
from rich.console import Console

cs = Console()

def main():
    deployer = accounts.load("test")
    #deployer.unlock(passphrase="a")
    deployer.set_autosign(True)
    cs.print("-" * 100)
    cs.print("Deploying by contract.deploy")
    cs.print("-" * 100)
    contract1 = project.SimpleContract.deploy(sender=deployer)
    
    cs.print("-" * 100)
    cs.print("Deploying by account.deploy")
    cs.print("-" * 100)
    contract2 = deployer.deploy(project.SimpleContract)
    cs.print("-" * 100)
    #print(contract1.address)

if __name__ == "__main__":
    main()

The output

image

Checklist

  • All changes are completed
  • Change is covered in tests
  • Documentation is complete

@Aviksaikat
Copy link
Contributor Author

Working on the project.SimpleContract.deploy part to show the address

@fubuloubu fubuloubu changed the title feat: initial commit. printing done for account api feat(AccountAPI): show deployment address before broadcast Jul 5, 2025
Copy link
Member

@fubuloubu fubuloubu left a comment

Choose a reason for hiding this comment

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

Can you post a printout of what this looks like (for both account.deploy and contract.deplpy`)

@Aviksaikat
Copy link
Contributor Author

Can you post a printout of what this looks like (for both account.deploy and contract.deplpy`)

Done

# TODO: Not possible method not available

if "sender" in kwargs:
possible_address = kwargs["sender"].get_deployment_address()
Copy link
Member

Choose a reason for hiding this comment

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

Technically sender can be an address type here still

fubuloubu
fubuloubu previously approved these changes Jul 13, 2025
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.

Show deploy's contract address _before_ waiting for confirmation
3 participants