Skip to content

Commit e24eeb9

Browse files
committed
Fixed from address for call options
`from` address for Call Options for contract binding should be set to the address of the signer, not address of the contract that is destination of the call.
1 parent a336ffc commit e24eeb9

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

tools/generators/ethereum/contract.go.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ func New{{.Class}}(
4545
transactionMutex *sync.Mutex,
4646
) (*{{.Class}}, error) {
4747
callerOptions := &bind.CallOpts{
48-
From: contractAddress,
48+
From: accountKey.Address,
4949
}
50+
5051
transactorOptions := bind.NewKeyedTransactor(
5152
accountKey.PrivateKey,
5253
)

tools/generators/ethereum/contract_template_content.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ func New{{.Class}}(
4848
transactionMutex *sync.Mutex,
4949
) (*{{.Class}}, error) {
5050
callerOptions := &bind.CallOpts{
51-
From: contractAddress,
51+
From: accountKey.Address,
5252
}
53+
5354
transactorOptions := bind.NewKeyedTransactor(
5455
accountKey.PrivateKey,
5556
)

0 commit comments

Comments
 (0)