Settings

ethcfgAddressSender

Type: String

Default: Unset

A hex ethereum address that will become the default sender for sessions started within this repository, overriding any default sender in the database.

This setting hardcodes the default sender address for sessions in the repository that sets it. Defining it results in the default sender address appearing in version control. It’s usually better not to commit to or expose a sender in the repository, and use ethAddressSender* tasks to manage the identity of your senders.

ethcfgAutoDeployContracts

Type: Seq[String]

Default: Unset

Contracts compiled from this repository that should be autodeployed if no arguments are provided to ethTransactionDeploy, or (in the Test configuration), within ethDebugGanacheTest. Contracts will be deployed in the order specified. The same contract can be deployed multiple times (with or without different constructor arguments and/or payments).

Each element of the Seq should be the name of the Contract to deploy, optionally with space separated constructor arguments for that contract. If the constructor is payable, you may optionally also include an amount following the last constructor argument, in the form of a numeric value and a unit, which should be one of wei, gwei, szabo, finney, or ether.

This setting is primarily used for smart-contract testing. See e.g. swaldman/quick-and-dirty-token-overview for a project that uses it.

Example

Test / ethcfgAutoDeployContracts := Seq( "MintableBurnableERC20", "ProxyableMintableBurnableERC20", "UpgradeabilityProxyFactory", "PausableMintableBurnableERC20" )

ethcfgBaseCurrencyCode

Type: String

Default: "USD"

ISO 4217 Currency Code for the currency ETH values should be translated to in transaction approval messages.

Note: Values other than “USD” have not been tested, and probably won’t work yet.

ethcfgEntropySource

Type: java.security.SecureRandom

Default: An instance of java.security.SecureRandom constructed and seeded via that class’ default constructor

The source of entropy used where randomness is required, especially generating new keys. You can customize this with custom initialization or via subclasses of java.security.SecureRandom

ethcfgGasLimitCap

Type: BigInt

Default: Unset

If set, this defines the maximum gas limit sbt-ethereum will allow in a transaction, regardless of its estimated gas cost.

Usually this should not be set! To control the gas limit precisely, you can use ethTransactionGasLimitOverrideSet in your session.

ethcfgGasLimitFloor

Type: BigInt

Default: Unset

If set, this defines the minimum gas limit sbt-ethereum will provide in a transaction, regardless of its estimated gas cost.

Usually this should not be set! To control the gas limit precisely, you can use ethTransactionGasLimitOverrideSet in your session.

ethcfgGasLimitMarkup

Type: Double

Default: 0.20

To set the transaction gas limit, sbt-ethereum estimates the transaction’s cost using its node’s eth_estimateGas function, and then adds a markup, 0.2 or 20% by default. Then any cap or floor is applied.

If you’d like a higher markup (to reduce the possibility of running out of gas) or a lower one (to more tightly limit transaction cost), you can define your own value for this setting.

This value can be negative, in which case it reflects a discount rather than a markup. However, it’s a bad idea — you’ll almost certainly just exhaust your gas and have to pay for failed transactions.

ethcfgGasPriceCap

Type: BigInt

Default: Unset

If set, this defines the maximum gas price in wei sbt-ethereum will allow in a transaction, regardless of its estimated prevailing gas price.

Usually this should not be set! To control the gas price precisely, you can use ethTransactionGasPriceOverrideSet in your session.

ethcfgGasPriceFloor

Type: BigInt

Default: Unset

If set, this defines the minimum gas price in wei sbt-ethereum will provide in a transaction, regardless of its estimated prevailing gas price.

Usually this should not be set! To control the gas price precisely, you can use ethTransactionGasPriceOverrideSet in your session.

ethcfgGasPriceMarkup

Type: Double

Default: 0.00

To set the transaction gas price, sbt-ethereum estimates the prevailing gas price using its node’s eth_gasPrice function, and then adds a markup, of 0.00 or 0% by default. Then any cap or floor is applied.

If you’d like a higher markup (to reduce the possibility of running out of gas) or a lower one (to require a discount to the prevailing cost), you can define your own value for this setting.

This value can be negative, in which case it reflects a discount rather than a markup.

ethcfgIncludeLocations

Type: Seq[String]

Default: Nil (an empty Seq)

A sequence of directories or URLs that should be searched to resolve Solidity import directives, besides the source directory itself.

ethcfgKeystoreAutoImportLocationsV3

Type: Seq[File]

Default: _a list containing the default geth keystore directory for your platform

A sequence of File objects representing directories containing ethereum V3 Wallet JSON files that should automatically be imported into the sbt-ethereum keystore.

ethcfgKeystoreAutoRelockSeconds

Type: Int

Default: 300

A number of seconds during which, after a wallet has been unlocked, its private key may remain available without retyping the wallet passcode.

ethcfgNetcompileUrl

Type: String

Default: Unset

The URL of a (nonstandard) network-hosted Solidity compiler.

Networked Solidity compilation using the eth-netcompile project is unlikely to be supported going forward. Please consider this setting deprecated.

ethcfgNodeChainId

Type: Int

Default: Unset (except in configuration Test, for which the default value is -1)

A “hardcoded” EIP-155 Chain ID that will override any default Chain ID set for the project.

Often you will rely upon the shoebox default (set with ethNodeChainIdDefaultSet) or the session override (set with ethNodeChainIdOverrideSet). However, if you want a project to be explicitly associated with a particular chain, you can set this. It will override any value set with ethNodeChainIdDefaultSet.

If a negative value is set, the chain will be treated as ephemeral. Deployments won’t be saved in the shoebox database, and no EIP-155 Chain ID will be embedded in signatures.

ethcfgNodeUrl

Type: String

Default: Unset (except in configuration Test, for which the default value is http://localhost:58545/)

A “hardcoded” EIP-155 ethereum node URL that will override any default Node URL set for the project.

Often you will rely upon the shoebox default for your session’s Chain ID (set with ethNodeUrlDefaultSet) or the session override (set with ethNodeUrlOverrideSet). However, if you want a project to be explicitly associated with a particular URL, you can set this. It will override any value set with ethNodeUrlDefaultSet.

ethcfgScalaStubsPackage

Type: String

Default: Unset

The dot-separated fully qualified package name into which Scala stubs for compiled smart contracts should be generated, if you’d like scala stubs for compiled smart contracts! If not set, no Scala stubs will be generated.

ethcfgSolidityCompilerOptimize

Type: Boolean

Default: true

Defines whether compiler optimization should be enabled during compilations of Solidity files.

ethcfgSolidityCompilerOptimizerRuns

Type: Boolean

Default: 200

Defines for how many runs (how exhaustively) the Solidity compiler should try to optimize, if Solidity compiler optimizations are enabled. (See ethcfgSolidityCompilerOptimize)

ethcfgSoliditySource

Type: File (a diectory)

Default: src/main/solidity (or, for the Test configuration, src/test/solidity)

Defines where sbt-ethereum looks for Solidity files to compile. Defined in terms of the standard sourceDirectory key: Unless overridden, this will be a solidity subdirectory of sourceDirectory.value.

ethcfgSolidityDestination

Type: File (a diectory)

Default: target/ethereum/solidity

Defines where Solidity compilation artifacts get stored. Defined in terms of the ethcfgTargetDir key: Unless overridden, this will be a solidity subdirectory of ethcfgTargetDir.value.

ethcfgTargetDir

Type: File (a diectory)

Default: target/ethereum

Defines where sbt-ethereum-related artifacts and compilations get stored. Defined in terms of the standard target key: Unless overridden, this will be an ethereum subdirectory of target.

ethcfgTransactionReceiptPollPeriod

Type: Duration

Default: 3 seconds

After a transaction is submitted, sbt-ethereum will “poll” its node for that transaction until it has been mined or times out.

This setting determines how frequently it will poll.

ethcfgTransactionReceiptTimeout

Type: Duration

Default: 5 minutes

After a transaction is submitted, sbt-ethereum will “poll” its node for that transaction until it has been mined or times out.

This setting determines how long sbt-ethereum will wait to see that a transaction has been mined onto a chain before giving up.

ethcfgUseReplayAttackProtection

Type: Boolean

Default: true

If there is a non-negative Chain ID associated with an sbt-ethereum session, sbt-ethereum can incorporate that in transaction signatures to prevent “replay” attacks, which occur when a valid transaction is submitted to an unintended chain.

If replay attack protection is enabled, transactions are only valid for the (hopefully unique) chain that matches the embedded Chain ID.

If replay attack prevention is not enabled, no Chain ID is encoded into the signature and a transaction might be valid for many chains.