@@ -24,17 +24,17 @@ type ConfirmRetryOptions struct {
2424
2525// DeployOptions defines optional parameters for deploying a smart contract.
2626type DeployOptions struct {
27- OeLimit int // Max energy the creator is willing to provide during execution.
28- CurPercent int // Percentage of resource consumption charged to the contract caller (0–100).
29- FeeLimit int // Max TRX to be used for deploying the contract (gas limit in Tron terms).
30- ConfirmRetryOptions ConfirmRetryOptions // Retry options for confirming the transaction.
27+ OeLimit int // Max energy the creator is willing to provide during execution.
28+ CurPercent int // Percentage of resource consumption charged to the contract caller (0–100).
29+ FeeLimit int // Max TRX to be used for deploying the contract (gas limit in Tron terms).
30+ ConfirmRetryOptions * ConfirmRetryOptions // Retry options for confirming the transaction.
3131}
3232
3333// TriggerOptions defines optional parameters for triggering (calling) a smart contract.
3434type TriggerOptions struct {
35- FeeLimit int32 // Max TRX to be used for this transaction call.
36- TAmount int64 // Amount of TRX to transfer along with the contract call (like msg.value).
37- ConfirmRetryOptions ConfirmRetryOptions // Retry options for confirming the transaction.
35+ FeeLimit int32 // Max TRX to be used for this transaction call.
36+ TAmount int64 // Amount of TRX to transfer along with the contract call (like msg.value).
37+ ConfirmRetryOptions * ConfirmRetryOptions // Retry options for confirming the transaction.
3838}
3939
4040// Chain represents a Tron chain
@@ -47,43 +47,43 @@ type Chain struct {
4747 DeployerSeed string // Optional: mnemonic or raw seed
4848
4949 // SendAndConfirm provides a utility function to send a transaction and waits for confirmation.
50- SendAndConfirm func (ctx context.Context , tx * common.Transaction , opts ... ConfirmRetryOptions ) (* soliditynode.TransactionInfo , error )
50+ SendAndConfirm func (ctx context.Context , tx * common.Transaction , opts * ConfirmRetryOptions ) (* soliditynode.TransactionInfo , error )
5151
5252 // DeployContractAndConfirm provides a utility function to deploy a contract and waits for confirmation.
5353 DeployContractAndConfirm func (
54- ctx context.Context , contractName string , abi string , bytecode string , params []interface {}, opts ... DeployOptions ,
54+ ctx context.Context , contractName string , abi string , bytecode string , params []interface {}, opts * DeployOptions ,
5555 ) (address.Address , * soliditynode.TransactionInfo , error )
5656
5757 // TriggerContractAndConfim provides a utility function to send a contract transaction and waits for confirmation.
5858 TriggerContractAndConfirm func (
59- ctx context.Context , contractAddr address.Address , functionName string , params []interface {}, opts ... TriggerOptions ,
59+ ctx context.Context , contractAddr address.Address , functionName string , params []interface {}, opts * TriggerOptions ,
6060 ) (* soliditynode.TransactionInfo , error )
6161}
6262
6363// DefaultConfirmRetryOptions returns standard retry options used across contract deployment and invocation.
6464// Defaults to 180 retries with a 500ms delay between each attempt.
65- func DefaultConfirmRetryOptions () ConfirmRetryOptions {
66- return ConfirmRetryOptions {
65+ func DefaultConfirmRetryOptions () * ConfirmRetryOptions {
66+ return & ConfirmRetryOptions {
6767 RetryAttempts : 180 ,
6868 RetryDelay : 500 * time .Millisecond ,
6969 }
7070}
7171
7272// DefaultDeployOptions returns default options used when deploying a contract.
7373// It includes a high fee and energy limit suitable for development/testing, and standard retry behavior.
74- func DefaultDeployOptions () DeployOptions {
75- return DeployOptions {
76- FeeLimit : 10_000_000 , // Default fee limit (in SUN).
77- CurPercent : 100 , // Caller pays full cost.
78- OeLimit : 10_000_000 , // Default energy limit.
74+ func DefaultDeployOptions () * DeployOptions {
75+ return & DeployOptions {
76+ FeeLimit : 100_000_000 , // Default fee limit (in SUN).
77+ CurPercent : 100 , // Caller pays full cost.
78+ OeLimit : 50_000_000 , // Default energy limit.
7979 ConfirmRetryOptions : DefaultConfirmRetryOptions (),
8080 }
8181}
8282
8383// DefaultTriggerOptions returns default options for calling smart contract methods.
8484// These defaults ensure calls succeed on local/dev environments without TRX transfer.
85- func DefaultTriggerOptions () TriggerOptions {
86- return TriggerOptions {
85+ func DefaultTriggerOptions () * TriggerOptions {
86+ return & TriggerOptions {
8787 FeeLimit : 10_000_000 , // Default fee limit (in SUN).
8888 TAmount : 0 , // No TRX transferred by default.
8989 ConfirmRetryOptions : DefaultConfirmRetryOptions (),
0 commit comments