Skip to content

Conversation

tr1sm0s1n
Copy link
Contributor

Rationale

Since we're already storing the deployment address inside BoundContract, a simple reader method would be helpful to access the same without allocating new variables.

For example, here's the PackConstructor method for the OpenZeppelin Governance contract:

func (myGovernor *MyGovernor) PackConstructor(_token common.Address, _timelock common.Address) []byte {
	enc, err := myGovernor.abi.Pack("", _token, _timelock)
	if err != nil {
		panic(err)
	}
	return enc
}

Since we've already deployed the token and timelock contracts and created instance wrappers for the same, simply calling Address() on those wrappers will be helpful here.

@fjl fjl merged commit 5d09aa3 into ethereum:master Sep 12, 2025
5 of 6 checks passed
@fjl fjl added this to the 1.16.4 milestone Sep 12, 2025
@tr1sm0s1n tr1sm0s1n deleted the boundcontract-address-method branch September 12, 2025 12:34
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.

3 participants