################################################################
#                   PROFILE: DEFAULT (local)                   #
################################################################

[profile.default]

src = 'src'
out = 'forge-artifacts'
script = 'scripts'
build_info_path = 'artifacts/build-info'

optimizer = true
optimizer_runs = 999999

extra_output = ['devdoc', 'userdoc', 'metadata', 'storageLayout']
bytecode_hash = 'none'
ast = true
evm_version = "cancun"

remappings = [
  '@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts',
  '@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts',
  '@openzeppelin/contracts-v5/=lib/openzeppelin-contracts-v5/contracts',
  '@rari-capital/solmate/=lib/solmate',
  '@lib-keccak/=lib/lib-keccak/contracts/lib',
  '@solady/=lib/solady/src',
  '@solady-v0.0.245/=lib/solady-v0.0.245/src',
  'forge-std/=lib/forge-std/src',
  'ds-test/=lib/forge-std/lib/ds-test/src',
  'safe-contracts/=lib/safe-contracts/contracts',
  'kontrol-cheatcodes/=lib/kontrol-cheatcodes/src',
  'gelato/=lib/automate/contracts'
]

fs_permissions = [
  { access='read-write', path='./.resource-metering.csv' },
  { access='read-write', path='./snapshots/' },
  { access='read-write', path='./deployments/' },
  { access='read', path='./deploy-config/' },
  { access='read', path='./deploy-config-periphery/' },
  { access='read', path='./broadcast/' },
  { access='read', path = './forge-artifacts/' },
  { access='read-write', path='./.testdata/' },
  { access='read', path='./kout-deployment' },
  { access='read', path='./test/fixtures' },
]

# 5159 error code is selfdestruct error code
ignored_error_codes = ["transient-storage", "code-size", "init-code-size", 5159]
ffi = true

# We set the gas limit to max int64 to avoid running out of gas during testing, since the default
# gas limit is 1B and some of our tests require more gas than that, such as
# test_callWithMinGas_noLeakageLow_succeeds. We use this gas limit since it was the default gas
# limit prior to https://github.com/foundry-rs/foundry/pull/8274. Due to toml-rs limitations, if
# you increase the gas limit above this value it must be a string.
gas_limit = 9223372036854775807

[fuzz]
runs = 64

[fmt]
line_length=120
multiline_func_header='all'
bracket_spacing=true
wrap_comments=true

################################################################
#                         PROFILE: CI                          #
################################################################

[profile.ci.fuzz]
runs = 512

[profile.ci.invariant]
runs = 256
depth = 32

################################################################
#                       PROFILE: CIHEAVY                       #
################################################################

[profile.ciheavy.fuzz]
runs = 20000

[profile.ciheavy.invariant]
runs = 128
depth = 512

################################################################
#                         PROFILE: LITE                        #
################################################################

[profile.lite]
optimizer = false

################################################################
#                         PROFILE: KONTROL                     #
################################################################

[profile.kprove]
src = 'test/kontrol/proofs'
out = 'kout-proofs'
test = 'test/kontrol/proofs'
script = 'test/kontrol/proofs'
