Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VaultParams refactoring #48

Merged
merged 102 commits into from
Jun 21, 2024
Merged

VaultParams refactoring #48

merged 102 commits into from
Jun 21, 2024

Conversation

Krishnakumarskr
Copy link
Member

No description provided.

Krishnakumarskr and others added 30 commits May 15, 2024 08:46
Manually altered the wrapping of some lines
Manually altered the wrapping of some lines
Removed the DEFAULT_ANVIL_KEY restored it to configuration files. Also renamed it DEPLOYER_PRIVATE_KEY
Copy link

openzeppelin-code bot commented May 23, 2024

VaultParams refactoring

Generated at commit: e048345919fb9d36dbe0dc0846a55e20e998888c

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
1
0
0
6
18
25
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

Copy link
Member

@jplodge-pro jplodge-pro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After our discussion, I'm not sure if I was supposed to mention the issues we discussed! So I did :D

packages/api/resource/api-local.toml Outdated Show resolved Hide resolved
packages/contracts/test/base/CredbullBaseVaultTest.t.sol Outdated Show resolved Hide resolved
packages/contracts/src/interface/ICredbull.sol Outdated Show resolved Hide resolved
packages/contracts/src/interface/ICredbull.sol Outdated Show resolved Hide resolved
Comment on lines +122 to +135
const depositWindowParam = {
opensAt: params.depositOpensAt,
closesAt: params.depositClosesAt,
};

const matureWindowParam = {
opensAt: params.redemptionOpensAt,
closesAt: params.redemptionClosesAt,
};

const windowVaultParams = {
depositWindow: depositWindowParam,
matureWindow: matureWindowParam,
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the deposit windows, i was thinking we could have a struct to represent the open and close at. generally, i'd prefer object types that are more descriptive over simple primitives.

for example below, this also raises the question, shouldn't a window be between two Dates (not numbers).

interface WindowParam {
  opensAt: BigNumber;
  closesAt: BigNumber;
}
    const depositWindowParam: WindowParam = {
      opensAt: params.depositOpensAt,
      closesAt: params.depositClosesAt,
    };

    const matureWindowParam: WindowParam = {
      opensAt: params.redemptionOpensAt,
      closesAt: params.redemptionClosesAt,
    };```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the idea of interfaces with the param values, then using multiple inheritance to realise a single params.
Sadly, interfaces don't allow state variables link (I would love to be wrong here!)
So we would have to use accessor functions, which would be a lot more cumbersome and would reduce the elegance of the solution I think.

// Read-only interface
interface IContractRoles {
    function getOwner() external returns (address);
    function getOperator() external returns (address);
    function getCustodian() external returns (address);
}

struct VaultParameters is IContractRoles {
...

Even still, as far as I can tell, only contracts themselves can realise interfaces, so making this design a non-starter.


contract CredbullFixedYieldVaultWithUpside is UpsideVault {
constructor(VaultParams memory params, IERC20 _token, uint256 _collateralPercentage)
constructor(ICredbull.FixedYieldVaultParams memory params, IERC20 _token, uint256 _collateralPercentage)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest to group the token and collateral percentage here into a UpsideVaultParams struct.

  1. suggest to rename token to something more explicit. tokenForLock or similar. having it within the UpsideVaultParams struct will also help with context. we have so many tokens on Vaults, it isn't obvious what this is!

  2. what is the collateralPercentage? is this the upsideReward that we get? or tokensRequiredForLock? let's rename it as appropriate.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. It is cbl token. tokens that are locked for upside.
  2. The percentage of CBL token to be locked for upside

Comment on lines +56 to +58
constructor(BaseVaultParams memory baseVaultParams)
ERC4626(baseVaultParams.asset)
ERC20(baseVaultParams.shareName, baseVaultParams.shareSymbol)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, love it! keeps our base very simple!

Comment on lines 71 to 78
struct MaturityVaultParams {
BaseVaultParams baseVaultParams;
ContractRoles contractRoles;
WindowVaultParams windowVaultParams;
KycParams kycParams;
MaxCapParams maxCapParams;
uint256 promisedYield;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicates FixedYieldVault - doesn't look like it's used anyhow. remove it.

Copy link
Member

@lucasia lucasia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see comments, looks good overall! please incorporate those few suggested changes.

@Krishnakumarskr Krishnakumarskr changed the base branch from development to main May 24, 2024 12:25
@Krishnakumarskr Krishnakumarskr merged commit 6cfff4e into main Jun 21, 2024
2 checks passed
jplodge-pro added a commit that referenced this pull request Jun 21, 2024
* split params init commit

* forge install: forge-std

v1.8.2

* Initial version of local and dev application configuration

* Add `js-toml` dependency.

* Update `.env.sample` to give clear instructions and remove unnecessary keys.

* Moved DEFAULT_ANVIL_KEY to its singular usage.
Manually altered the wrapping of some lines

* Updated deployment helper JS scripts to use TOML application config.

* Fixed some new solc warnings.

* Now using TOML application config to control deployment.

* Re-submit with auto-formatted changes.

* Proposed changes to the GitHub Actions

* Added decoder logic in read/write response

* refactored handle error logic

* Moving DeployTestVault under test package.

* Updated the env sample files to clearly name the expected Account Addresses/Private Keys.

* Added an env key stub to workaround local deploy problems.

* Added more detail to the documentation.

* Update `.env.sample` to give clear instructions and remove unnecessary keys.

* Moved DEFAULT_ANVIL_KEY to its singular usage.
Manually altered the wrapping of some lines

* Moved the config functionality into it's own module, used by both it's peer modules.

* Corrected a badly rebased Makefile.
Removed the DEFAULT_ANVIL_KEY restored it to configuration files. Also renamed it DEPLOYER_PRIVATE_KEY

* Updated the sample file removing moved config points.

* Sepolia config now uses the TOML file.

* Corrected badly-merged local vault command.

* Add TOML files for all the supported environments.

* Updated to use the correct Supabase config item key.

* Linting fixes

* Corrected the shared config code to be exportable.

* Lint fixes.

* Improved post-load config log comment.

* Agh, another lint change.

* Revert "Proposed changes to the GitHub Actions"

This reverts commit 104ab40.

* Try to fix duplicate IERC20 type import

* Manually remove the duplicate IERC20 definition.  See dependency graph using 'forge tree'

* Changing the github actions to trigger from main and development branch

* Make Readme more executable

* Update contracts git-hub actions script

* Updating testnet Env to deploy to baseSepolia

* Fix supabase URL for testnet

* Moved keys out of toml and into secrets (testnet) or env (local only)

* Add yarn to contracts/ github actions to run it locally

* Add Readme for running github actions locally

* Adding yarn to api github actions to run locally

* First cut of using toml in API, starting with app.controller.ts

* Fix linting issue

* Rename TomlConfig file to tomlConfig.ts

* Remove yarn install step from github actions, some errant failures

* Minor Readme updates to start build

* Fix name for check-env github action

* Issue with yarn install now can't find ./types module.  Reverting some package.json changes

* Fix compile error

* Use the dev env in api github actions.  Testnet missing sentry  keys (amongst others).

* Removed some unused keys from the sample

* Upgrade to `dotenv` 16.4.5 to enable multi-path configuration.
Updated `config.ts` to load local env files hierarchically.

* Change to use `.env` instead of `.env.local`
Re-added a `.env.sample` in `contracts`, as `make` and `forge` use it too.

* Added configuration loading documentation to the Makefile.
Added some console logging for clarity.

* The ETH Config functions were identical, so I re-factored it.
Updated some comments to be more accurate .

* Enabled hierarchical loading of `.env` files.
Removed usage of `.env.local` to be consistent across modules.
Enable nestjs CLI to copy the resource files to the `dist` directory.

* Renamed `.env.local.sample`
Linted formatting changes.

* Edit to include any resource tree and to watch those files too.

* Cleanup imports after linting

* Makefil to call yarn db-export rather than node.  Minor Readme cleanup

* Using TomlConfigService across API, replacing Config.

* Default to local env in TomlConfigService

* Fix github actions triggers

* Get TomlConfigService from the app.

* Changed API to use Github actions testnet secrets

* Update Fly.io deploy token.  Hopefully fix the build

* Update Fly.io deploy token.  Hopefully fix the build

* Readme hint on fly deploy token

* Adding deploy to bitlayerTestnet

* Adding test of tomlConfig.  Minor variable renaming

* Adding test of tomlConfig.  Minor variable renaming

* Renamed toml in contracts package

* Updating github actions to checkout@v4.  Node 16 is deprecated.

* Cleared Keys out of toml - shouldn't be checked in

* Adding Operating Key to github actions to fix the build

* Fix config in checkDb and exporter.  Suppress output of key in makefile

* Change API to use service key.  Anon user doesn't have sufficient access

* Changing a few more to Supabase service key.

* Updatig fly.io config

* Changing api toml paths to make fly.io happy

* Changing api toml paths to make fly.io happy

* Still can't get fly.io to read the toml.  Moving back to where it started

* contract changes in changing vault params

* fixed lint errors

* params change in backend and scripts

* changes in operation script

* fixed upside vault params

* lint fix

* Interface refactoring (#54)

* icredbull removed

* refactored ICredbull structs

* removed ICredbull file

* added IErrors

* type changes in scripts

* new refactored changes

* notification service console logger

* resolved toml and readme conflicts

---------

Co-authored-by: Jonathan Lodge <[email protected]>
Co-authored-by: Ian Lucas <[email protected]>
jplodge-pro added a commit that referenced this pull request Jun 21, 2024
* split params init commit

* forge install: forge-std

v1.8.2

* Initial version of local and dev application configuration

* Add `js-toml` dependency.

* Update `.env.sample` to give clear instructions and remove unnecessary keys.

* Moved DEFAULT_ANVIL_KEY to its singular usage.
Manually altered the wrapping of some lines

* Updated deployment helper JS scripts to use TOML application config.

* Fixed some new solc warnings.

* Now using TOML application config to control deployment.

* Re-submit with auto-formatted changes.

* Proposed changes to the GitHub Actions

* Added decoder logic in read/write response

* refactored handle error logic

* Moving DeployTestVault under test package.

* Updated the env sample files to clearly name the expected Account Addresses/Private Keys.

* Added an env key stub to workaround local deploy problems.

* Added more detail to the documentation.

* Update `.env.sample` to give clear instructions and remove unnecessary keys.

* Moved DEFAULT_ANVIL_KEY to its singular usage.
Manually altered the wrapping of some lines

* Moved the config functionality into it's own module, used by both it's peer modules.

* Corrected a badly rebased Makefile.
Removed the DEFAULT_ANVIL_KEY restored it to configuration files. Also renamed it DEPLOYER_PRIVATE_KEY

* Updated the sample file removing moved config points.

* Sepolia config now uses the TOML file.

* Corrected badly-merged local vault command.

* Add TOML files for all the supported environments.

* Updated to use the correct Supabase config item key.

* Linting fixes

* Corrected the shared config code to be exportable.

* Lint fixes.

* Improved post-load config log comment.

* Agh, another lint change.

* Revert "Proposed changes to the GitHub Actions"

This reverts commit 104ab40.

* Try to fix duplicate IERC20 type import

* Manually remove the duplicate IERC20 definition.  See dependency graph using 'forge tree'

* Changing the github actions to trigger from main and development branch

* Make Readme more executable

* Update contracts git-hub actions script

* Updating testnet Env to deploy to baseSepolia

* Fix supabase URL for testnet

* Moved keys out of toml and into secrets (testnet) or env (local only)

* Add yarn to contracts/ github actions to run it locally

* Add Readme for running github actions locally

* Adding yarn to api github actions to run locally

* First cut of using toml in API, starting with app.controller.ts

* Fix linting issue

* Rename TomlConfig file to tomlConfig.ts

* Remove yarn install step from github actions, some errant failures

* Minor Readme updates to start build

* Fix name for check-env github action

* Issue with yarn install now can't find ./types module.  Reverting some package.json changes

* Fix compile error

* Use the dev env in api github actions.  Testnet missing sentry  keys (amongst others).

* Removed some unused keys from the sample

* Upgrade to `dotenv` 16.4.5 to enable multi-path configuration.
Updated `config.ts` to load local env files hierarchically.

* Change to use `.env` instead of `.env.local`
Re-added a `.env.sample` in `contracts`, as `make` and `forge` use it too.

* Added configuration loading documentation to the Makefile.
Added some console logging for clarity.

* The ETH Config functions were identical, so I re-factored it.
Updated some comments to be more accurate .

* Enabled hierarchical loading of `.env` files.
Removed usage of `.env.local` to be consistent across modules.
Enable nestjs CLI to copy the resource files to the `dist` directory.

* Renamed `.env.local.sample`
Linted formatting changes.

* Edit to include any resource tree and to watch those files too.

* Cleanup imports after linting

* Makefil to call yarn db-export rather than node.  Minor Readme cleanup

* Using TomlConfigService across API, replacing Config.

* Default to local env in TomlConfigService

* Fix github actions triggers

* Get TomlConfigService from the app.

* Changed API to use Github actions testnet secrets

* Update Fly.io deploy token.  Hopefully fix the build

* Update Fly.io deploy token.  Hopefully fix the build

* Readme hint on fly deploy token

* Adding deploy to bitlayerTestnet

* Adding test of tomlConfig.  Minor variable renaming

* Adding test of tomlConfig.  Minor variable renaming

* Renamed toml in contracts package

* Updating github actions to checkout@v4.  Node 16 is deprecated.

* Cleared Keys out of toml - shouldn't be checked in

* Adding Operating Key to github actions to fix the build

* Fix config in checkDb and exporter.  Suppress output of key in makefile

* Change API to use service key.  Anon user doesn't have sufficient access

* Changing a few more to Supabase service key.

* Updatig fly.io config

* Changing api toml paths to make fly.io happy

* Changing api toml paths to make fly.io happy

* Still can't get fly.io to read the toml.  Moving back to where it started

* contract changes in changing vault params

* fixed lint errors

* params change in backend and scripts

* changes in operation script

* fixed upside vault params

* lint fix

* Interface refactoring (#54)

* icredbull removed

* refactored ICredbull structs

* removed ICredbull file

* added IErrors

* type changes in scripts

* new refactored changes

* notification service console logger

* resolved toml and readme conflicts

---------

Co-authored-by: Jonathan Lodge <[email protected]>
Co-authored-by: Ian Lucas <[email protected]>
jplodge-pro added a commit that referenced this pull request Jun 27, 2024
* split params init commit

* forge install: forge-std

v1.8.2

* Initial version of local and dev application configuration

* Add `js-toml` dependency.

* Update `.env.sample` to give clear instructions and remove unnecessary keys.

* Moved DEFAULT_ANVIL_KEY to its singular usage.
Manually altered the wrapping of some lines

* Updated deployment helper JS scripts to use TOML application config.

* Fixed some new solc warnings.

* Now using TOML application config to control deployment.

* Re-submit with auto-formatted changes.

* Proposed changes to the GitHub Actions

* Added decoder logic in read/write response

* refactored handle error logic

* Moving DeployTestVault under test package.

* Updated the env sample files to clearly name the expected Account Addresses/Private Keys.

* Added an env key stub to workaround local deploy problems.

* Added more detail to the documentation.

* Update `.env.sample` to give clear instructions and remove unnecessary keys.

* Moved DEFAULT_ANVIL_KEY to its singular usage.
Manually altered the wrapping of some lines

* Moved the config functionality into it's own module, used by both it's peer modules.

* Corrected a badly rebased Makefile.
Removed the DEFAULT_ANVIL_KEY restored it to configuration files. Also renamed it DEPLOYER_PRIVATE_KEY

* Updated the sample file removing moved config points.

* Sepolia config now uses the TOML file.

* Corrected badly-merged local vault command.

* Add TOML files for all the supported environments.

* Updated to use the correct Supabase config item key.

* Linting fixes

* Corrected the shared config code to be exportable.

* Lint fixes.

* Improved post-load config log comment.

* Agh, another lint change.

* Revert "Proposed changes to the GitHub Actions"

This reverts commit 104ab40.

* Try to fix duplicate IERC20 type import

* Manually remove the duplicate IERC20 definition.  See dependency graph using 'forge tree'

* Changing the github actions to trigger from main and development branch

* Make Readme more executable

* Update contracts git-hub actions script

* Updating testnet Env to deploy to baseSepolia

* Fix supabase URL for testnet

* Moved keys out of toml and into secrets (testnet) or env (local only)

* Add yarn to contracts/ github actions to run it locally

* Add Readme for running github actions locally

* Adding yarn to api github actions to run locally

* First cut of using toml in API, starting with app.controller.ts

* Fix linting issue

* Rename TomlConfig file to tomlConfig.ts

* Remove yarn install step from github actions, some errant failures

* Minor Readme updates to start build

* Fix name for check-env github action

* Issue with yarn install now can't find ./types module.  Reverting some package.json changes

* Fix compile error

* Use the dev env in api github actions.  Testnet missing sentry  keys (amongst others).

* Removed some unused keys from the sample

* Upgrade to `dotenv` 16.4.5 to enable multi-path configuration.
Updated `config.ts` to load local env files hierarchically.

* Change to use `.env` instead of `.env.local`
Re-added a `.env.sample` in `contracts`, as `make` and `forge` use it too.

* Added configuration loading documentation to the Makefile.
Added some console logging for clarity.

* The ETH Config functions were identical, so I re-factored it.
Updated some comments to be more accurate .

* Enabled hierarchical loading of `.env` files.
Removed usage of `.env.local` to be consistent across modules.
Enable nestjs CLI to copy the resource files to the `dist` directory.

* Renamed `.env.local.sample`
Linted formatting changes.

* Edit to include any resource tree and to watch those files too.

* Cleanup imports after linting

* Makefil to call yarn db-export rather than node.  Minor Readme cleanup

* Using TomlConfigService across API, replacing Config.

* Default to local env in TomlConfigService

* Fix github actions triggers

* Get TomlConfigService from the app.

* Changed API to use Github actions testnet secrets

* Update Fly.io deploy token.  Hopefully fix the build

* Update Fly.io deploy token.  Hopefully fix the build

* Readme hint on fly deploy token

* Adding deploy to bitlayerTestnet

* Adding test of tomlConfig.  Minor variable renaming

* Adding test of tomlConfig.  Minor variable renaming

* Renamed toml in contracts package

* Updating github actions to checkout@v4.  Node 16 is deprecated.

* Cleared Keys out of toml - shouldn't be checked in

* Adding Operating Key to github actions to fix the build

* Fix config in checkDb and exporter.  Suppress output of key in makefile

* Change API to use service key.  Anon user doesn't have sufficient access

* Changing a few more to Supabase service key.

* Updatig fly.io config

* Changing api toml paths to make fly.io happy

* Changing api toml paths to make fly.io happy

* Still can't get fly.io to read the toml.  Moving back to where it started

* contract changes in changing vault params

* fixed lint errors

* params change in backend and scripts

* changes in operation script

* fixed upside vault params

* lint fix

* Interface refactoring (#54)

* icredbull removed

* refactored ICredbull structs

* removed ICredbull file

* added IErrors

* type changes in scripts

* new refactored changes

* notification service console logger

* resolved toml and readme conflicts

---------

Co-authored-by: Jonathan Lodge <[email protected]>
Co-authored-by: Ian Lucas <[email protected]>
jplodge-pro added a commit that referenced this pull request Jun 27, 2024
* split params init commit

* forge install: forge-std

v1.8.2

* Initial version of local and dev application configuration

* Add `js-toml` dependency.

* Update `.env.sample` to give clear instructions and remove unnecessary keys.

* Moved DEFAULT_ANVIL_KEY to its singular usage.
Manually altered the wrapping of some lines

* Updated deployment helper JS scripts to use TOML application config.

* Fixed some new solc warnings.

* Now using TOML application config to control deployment.

* Re-submit with auto-formatted changes.

* Proposed changes to the GitHub Actions

* Added decoder logic in read/write response

* refactored handle error logic

* Moving DeployTestVault under test package.

* Updated the env sample files to clearly name the expected Account Addresses/Private Keys.

* Added an env key stub to workaround local deploy problems.

* Added more detail to the documentation.

* Update `.env.sample` to give clear instructions and remove unnecessary keys.

* Moved DEFAULT_ANVIL_KEY to its singular usage.
Manually altered the wrapping of some lines

* Moved the config functionality into it's own module, used by both it's peer modules.

* Corrected a badly rebased Makefile.
Removed the DEFAULT_ANVIL_KEY restored it to configuration files. Also renamed it DEPLOYER_PRIVATE_KEY

* Updated the sample file removing moved config points.

* Sepolia config now uses the TOML file.

* Corrected badly-merged local vault command.

* Add TOML files for all the supported environments.

* Updated to use the correct Supabase config item key.

* Linting fixes

* Corrected the shared config code to be exportable.

* Lint fixes.

* Improved post-load config log comment.

* Agh, another lint change.

* Revert "Proposed changes to the GitHub Actions"

This reverts commit 104ab40.

* Try to fix duplicate IERC20 type import

* Manually remove the duplicate IERC20 definition.  See dependency graph using 'forge tree'

* Changing the github actions to trigger from main and development branch

* Make Readme more executable

* Update contracts git-hub actions script

* Updating testnet Env to deploy to baseSepolia

* Fix supabase URL for testnet

* Moved keys out of toml and into secrets (testnet) or env (local only)

* Add yarn to contracts/ github actions to run it locally

* Add Readme for running github actions locally

* Adding yarn to api github actions to run locally

* First cut of using toml in API, starting with app.controller.ts

* Fix linting issue

* Rename TomlConfig file to tomlConfig.ts

* Remove yarn install step from github actions, some errant failures

* Minor Readme updates to start build

* Fix name for check-env github action

* Issue with yarn install now can't find ./types module.  Reverting some package.json changes

* Fix compile error

* Use the dev env in api github actions.  Testnet missing sentry  keys (amongst others).

* Removed some unused keys from the sample

* Upgrade to `dotenv` 16.4.5 to enable multi-path configuration.
Updated `config.ts` to load local env files hierarchically.

* Change to use `.env` instead of `.env.local`
Re-added a `.env.sample` in `contracts`, as `make` and `forge` use it too.

* Added configuration loading documentation to the Makefile.
Added some console logging for clarity.

* The ETH Config functions were identical, so I re-factored it.
Updated some comments to be more accurate .

* Enabled hierarchical loading of `.env` files.
Removed usage of `.env.local` to be consistent across modules.
Enable nestjs CLI to copy the resource files to the `dist` directory.

* Renamed `.env.local.sample`
Linted formatting changes.

* Edit to include any resource tree and to watch those files too.

* Cleanup imports after linting

* Makefil to call yarn db-export rather than node.  Minor Readme cleanup

* Using TomlConfigService across API, replacing Config.

* Default to local env in TomlConfigService

* Fix github actions triggers

* Get TomlConfigService from the app.

* Changed API to use Github actions testnet secrets

* Update Fly.io deploy token.  Hopefully fix the build

* Update Fly.io deploy token.  Hopefully fix the build

* Readme hint on fly deploy token

* Adding deploy to bitlayerTestnet

* Adding test of tomlConfig.  Minor variable renaming

* Adding test of tomlConfig.  Minor variable renaming

* Renamed toml in contracts package

* Updating github actions to checkout@v4.  Node 16 is deprecated.

* Cleared Keys out of toml - shouldn't be checked in

* Adding Operating Key to github actions to fix the build

* Fix config in checkDb and exporter.  Suppress output of key in makefile

* Change API to use service key.  Anon user doesn't have sufficient access

* Changing a few more to Supabase service key.

* Updatig fly.io config

* Changing api toml paths to make fly.io happy

* Changing api toml paths to make fly.io happy

* Still can't get fly.io to read the toml.  Moving back to where it started

* contract changes in changing vault params

* fixed lint errors

* params change in backend and scripts

* changes in operation script

* fixed upside vault params

* lint fix

* Interface refactoring (#54)

* icredbull removed

* refactored ICredbull structs

* removed ICredbull file

* added IErrors

* type changes in scripts

* new refactored changes

* notification service console logger

* resolved toml and readme conflicts

---------

Co-authored-by: Jonathan Lodge <[email protected]>
Co-authored-by: Ian Lucas <[email protected]>
jplodge-pro added a commit that referenced this pull request Jun 27, 2024
* split params init commit

* forge install: forge-std

v1.8.2

* Initial version of local and dev application configuration

* Add `js-toml` dependency.

* Update `.env.sample` to give clear instructions and remove unnecessary keys.

* Moved DEFAULT_ANVIL_KEY to its singular usage.
Manually altered the wrapping of some lines

* Updated deployment helper JS scripts to use TOML application config.

* Fixed some new solc warnings.

* Now using TOML application config to control deployment.

* Re-submit with auto-formatted changes.

* Proposed changes to the GitHub Actions

* Added decoder logic in read/write response

* refactored handle error logic

* Moving DeployTestVault under test package.

* Updated the env sample files to clearly name the expected Account Addresses/Private Keys.

* Added an env key stub to workaround local deploy problems.

* Added more detail to the documentation.

* Update `.env.sample` to give clear instructions and remove unnecessary keys.

* Moved DEFAULT_ANVIL_KEY to its singular usage.
Manually altered the wrapping of some lines

* Moved the config functionality into it's own module, used by both it's peer modules.

* Corrected a badly rebased Makefile.
Removed the DEFAULT_ANVIL_KEY restored it to configuration files. Also renamed it DEPLOYER_PRIVATE_KEY

* Updated the sample file removing moved config points.

* Sepolia config now uses the TOML file.

* Corrected badly-merged local vault command.

* Add TOML files for all the supported environments.

* Updated to use the correct Supabase config item key.

* Linting fixes

* Corrected the shared config code to be exportable.

* Lint fixes.

* Improved post-load config log comment.

* Agh, another lint change.

* Revert "Proposed changes to the GitHub Actions"

This reverts commit 104ab40.

* Try to fix duplicate IERC20 type import

* Manually remove the duplicate IERC20 definition.  See dependency graph using 'forge tree'

* Changing the github actions to trigger from main and development branch

* Make Readme more executable

* Update contracts git-hub actions script

* Updating testnet Env to deploy to baseSepolia

* Fix supabase URL for testnet

* Moved keys out of toml and into secrets (testnet) or env (local only)

* Add yarn to contracts/ github actions to run it locally

* Add Readme for running github actions locally

* Adding yarn to api github actions to run locally

* First cut of using toml in API, starting with app.controller.ts

* Fix linting issue

* Rename TomlConfig file to tomlConfig.ts

* Remove yarn install step from github actions, some errant failures

* Minor Readme updates to start build

* Fix name for check-env github action

* Issue with yarn install now can't find ./types module.  Reverting some package.json changes

* Fix compile error

* Use the dev env in api github actions.  Testnet missing sentry  keys (amongst others).

* Removed some unused keys from the sample

* Upgrade to `dotenv` 16.4.5 to enable multi-path configuration.
Updated `config.ts` to load local env files hierarchically.

* Change to use `.env` instead of `.env.local`
Re-added a `.env.sample` in `contracts`, as `make` and `forge` use it too.

* Added configuration loading documentation to the Makefile.
Added some console logging for clarity.

* The ETH Config functions were identical, so I re-factored it.
Updated some comments to be more accurate .

* Enabled hierarchical loading of `.env` files.
Removed usage of `.env.local` to be consistent across modules.
Enable nestjs CLI to copy the resource files to the `dist` directory.

* Renamed `.env.local.sample`
Linted formatting changes.

* Edit to include any resource tree and to watch those files too.

* Cleanup imports after linting

* Makefil to call yarn db-export rather than node.  Minor Readme cleanup

* Using TomlConfigService across API, replacing Config.

* Default to local env in TomlConfigService

* Fix github actions triggers

* Get TomlConfigService from the app.

* Changed API to use Github actions testnet secrets

* Update Fly.io deploy token.  Hopefully fix the build

* Update Fly.io deploy token.  Hopefully fix the build

* Readme hint on fly deploy token

* Adding deploy to bitlayerTestnet

* Adding test of tomlConfig.  Minor variable renaming

* Adding test of tomlConfig.  Minor variable renaming

* Renamed toml in contracts package

* Updating github actions to checkout@v4.  Node 16 is deprecated.

* Cleared Keys out of toml - shouldn't be checked in

* Adding Operating Key to github actions to fix the build

* Fix config in checkDb and exporter.  Suppress output of key in makefile

* Change API to use service key.  Anon user doesn't have sufficient access

* Changing a few more to Supabase service key.

* Updatig fly.io config

* Changing api toml paths to make fly.io happy

* Changing api toml paths to make fly.io happy

* Still can't get fly.io to read the toml.  Moving back to where it started

* contract changes in changing vault params

* fixed lint errors

* params change in backend and scripts

* changes in operation script

* fixed upside vault params

* lint fix

* Interface refactoring (#54)

* icredbull removed

* refactored ICredbull structs

* removed ICredbull file

* added IErrors

* type changes in scripts

* new refactored changes

* notification service console logger

* resolved toml and readme conflicts

---------

Co-authored-by: Jonathan Lodge <[email protected]>
Co-authored-by: Ian Lucas <[email protected]>
jplodge-pro added a commit that referenced this pull request Jul 1, 2024
* split params init commit

* forge install: forge-std

v1.8.2

* Initial version of local and dev application configuration

* Add `js-toml` dependency.

* Update `.env.sample` to give clear instructions and remove unnecessary keys.

* Moved DEFAULT_ANVIL_KEY to its singular usage.
Manually altered the wrapping of some lines

* Updated deployment helper JS scripts to use TOML application config.

* Fixed some new solc warnings.

* Now using TOML application config to control deployment.

* Re-submit with auto-formatted changes.

* Proposed changes to the GitHub Actions

* Added decoder logic in read/write response

* refactored handle error logic

* Moving DeployTestVault under test package.

* Updated the env sample files to clearly name the expected Account Addresses/Private Keys.

* Added an env key stub to workaround local deploy problems.

* Added more detail to the documentation.

* Update `.env.sample` to give clear instructions and remove unnecessary keys.

* Moved DEFAULT_ANVIL_KEY to its singular usage.
Manually altered the wrapping of some lines

* Moved the config functionality into it's own module, used by both it's peer modules.

* Corrected a badly rebased Makefile.
Removed the DEFAULT_ANVIL_KEY restored it to configuration files. Also renamed it DEPLOYER_PRIVATE_KEY

* Updated the sample file removing moved config points.

* Sepolia config now uses the TOML file.

* Corrected badly-merged local vault command.

* Add TOML files for all the supported environments.

* Updated to use the correct Supabase config item key.

* Linting fixes

* Corrected the shared config code to be exportable.

* Lint fixes.

* Improved post-load config log comment.

* Agh, another lint change.

* Revert "Proposed changes to the GitHub Actions"

This reverts commit 104ab40.

* Try to fix duplicate IERC20 type import

* Manually remove the duplicate IERC20 definition.  See dependency graph using 'forge tree'

* Changing the github actions to trigger from main and development branch

* Make Readme more executable

* Update contracts git-hub actions script

* Updating testnet Env to deploy to baseSepolia

* Fix supabase URL for testnet

* Moved keys out of toml and into secrets (testnet) or env (local only)

* Add yarn to contracts/ github actions to run it locally

* Add Readme for running github actions locally

* Adding yarn to api github actions to run locally

* First cut of using toml in API, starting with app.controller.ts

* Fix linting issue

* Rename TomlConfig file to tomlConfig.ts

* Remove yarn install step from github actions, some errant failures

* Minor Readme updates to start build

* Fix name for check-env github action

* Issue with yarn install now can't find ./types module.  Reverting some package.json changes

* Fix compile error

* Use the dev env in api github actions.  Testnet missing sentry  keys (amongst others).

* Removed some unused keys from the sample

* Upgrade to `dotenv` 16.4.5 to enable multi-path configuration.
Updated `config.ts` to load local env files hierarchically.

* Change to use `.env` instead of `.env.local`
Re-added a `.env.sample` in `contracts`, as `make` and `forge` use it too.

* Added configuration loading documentation to the Makefile.
Added some console logging for clarity.

* The ETH Config functions were identical, so I re-factored it.
Updated some comments to be more accurate .

* Enabled hierarchical loading of `.env` files.
Removed usage of `.env.local` to be consistent across modules.
Enable nestjs CLI to copy the resource files to the `dist` directory.

* Renamed `.env.local.sample`
Linted formatting changes.

* Edit to include any resource tree and to watch those files too.

* Cleanup imports after linting

* Makefil to call yarn db-export rather than node.  Minor Readme cleanup

* Using TomlConfigService across API, replacing Config.

* Default to local env in TomlConfigService

* Fix github actions triggers

* Get TomlConfigService from the app.

* Changed API to use Github actions testnet secrets

* Update Fly.io deploy token.  Hopefully fix the build

* Update Fly.io deploy token.  Hopefully fix the build

* Readme hint on fly deploy token

* Adding deploy to bitlayerTestnet

* Adding test of tomlConfig.  Minor variable renaming

* Adding test of tomlConfig.  Minor variable renaming

* Renamed toml in contracts package

* Updating github actions to checkout@v4.  Node 16 is deprecated.

* Cleared Keys out of toml - shouldn't be checked in

* Adding Operating Key to github actions to fix the build

* Fix config in checkDb and exporter.  Suppress output of key in makefile

* Change API to use service key.  Anon user doesn't have sufficient access

* Changing a few more to Supabase service key.

* Updatig fly.io config

* Changing api toml paths to make fly.io happy

* Changing api toml paths to make fly.io happy

* Still can't get fly.io to read the toml.  Moving back to where it started

* contract changes in changing vault params

* fixed lint errors

* params change in backend and scripts

* changes in operation script

* fixed upside vault params

* lint fix

* Interface refactoring (#54)

* icredbull removed

* refactored ICredbull structs

* removed ICredbull file

* added IErrors

* type changes in scripts

* new refactored changes

* notification service console logger

* resolved toml and readme conflicts

---------

Co-authored-by: Jonathan Lodge <[email protected]>
Co-authored-by: Ian Lucas <[email protected]>
jplodge-pro added a commit that referenced this pull request Jul 1, 2024
* split params init commit

* forge install: forge-std

v1.8.2

* Initial version of local and dev application configuration

* Add `js-toml` dependency.

* Update `.env.sample` to give clear instructions and remove unnecessary keys.

* Moved DEFAULT_ANVIL_KEY to its singular usage.
Manually altered the wrapping of some lines

* Updated deployment helper JS scripts to use TOML application config.

* Fixed some new solc warnings.

* Now using TOML application config to control deployment.

* Re-submit with auto-formatted changes.

* Proposed changes to the GitHub Actions

* Added decoder logic in read/write response

* refactored handle error logic

* Moving DeployTestVault under test package.

* Updated the env sample files to clearly name the expected Account Addresses/Private Keys.

* Added an env key stub to workaround local deploy problems.

* Added more detail to the documentation.

* Update `.env.sample` to give clear instructions and remove unnecessary keys.

* Moved DEFAULT_ANVIL_KEY to its singular usage.
Manually altered the wrapping of some lines

* Moved the config functionality into it's own module, used by both it's peer modules.

* Corrected a badly rebased Makefile.
Removed the DEFAULT_ANVIL_KEY restored it to configuration files. Also renamed it DEPLOYER_PRIVATE_KEY

* Updated the sample file removing moved config points.

* Sepolia config now uses the TOML file.

* Corrected badly-merged local vault command.

* Add TOML files for all the supported environments.

* Updated to use the correct Supabase config item key.

* Linting fixes

* Corrected the shared config code to be exportable.

* Lint fixes.

* Improved post-load config log comment.

* Agh, another lint change.

* Revert "Proposed changes to the GitHub Actions"

This reverts commit 104ab40.

* Try to fix duplicate IERC20 type import

* Manually remove the duplicate IERC20 definition.  See dependency graph using 'forge tree'

* Changing the github actions to trigger from main and development branch

* Make Readme more executable

* Update contracts git-hub actions script

* Updating testnet Env to deploy to baseSepolia

* Fix supabase URL for testnet

* Moved keys out of toml and into secrets (testnet) or env (local only)

* Add yarn to contracts/ github actions to run it locally

* Add Readme for running github actions locally

* Adding yarn to api github actions to run locally

* First cut of using toml in API, starting with app.controller.ts

* Fix linting issue

* Rename TomlConfig file to tomlConfig.ts

* Remove yarn install step from github actions, some errant failures

* Minor Readme updates to start build

* Fix name for check-env github action

* Issue with yarn install now can't find ./types module.  Reverting some package.json changes

* Fix compile error

* Use the dev env in api github actions.  Testnet missing sentry  keys (amongst others).

* Removed some unused keys from the sample

* Upgrade to `dotenv` 16.4.5 to enable multi-path configuration.
Updated `config.ts` to load local env files hierarchically.

* Change to use `.env` instead of `.env.local`
Re-added a `.env.sample` in `contracts`, as `make` and `forge` use it too.

* Added configuration loading documentation to the Makefile.
Added some console logging for clarity.

* The ETH Config functions were identical, so I re-factored it.
Updated some comments to be more accurate .

* Enabled hierarchical loading of `.env` files.
Removed usage of `.env.local` to be consistent across modules.
Enable nestjs CLI to copy the resource files to the `dist` directory.

* Renamed `.env.local.sample`
Linted formatting changes.

* Edit to include any resource tree and to watch those files too.

* Cleanup imports after linting

* Makefil to call yarn db-export rather than node.  Minor Readme cleanup

* Using TomlConfigService across API, replacing Config.

* Default to local env in TomlConfigService

* Fix github actions triggers

* Get TomlConfigService from the app.

* Changed API to use Github actions testnet secrets

* Update Fly.io deploy token.  Hopefully fix the build

* Update Fly.io deploy token.  Hopefully fix the build

* Readme hint on fly deploy token

* Adding deploy to bitlayerTestnet

* Adding test of tomlConfig.  Minor variable renaming

* Adding test of tomlConfig.  Minor variable renaming

* Renamed toml in contracts package

* Updating github actions to checkout@v4.  Node 16 is deprecated.

* Cleared Keys out of toml - shouldn't be checked in

* Adding Operating Key to github actions to fix the build

* Fix config in checkDb and exporter.  Suppress output of key in makefile

* Change API to use service key.  Anon user doesn't have sufficient access

* Changing a few more to Supabase service key.

* Updatig fly.io config

* Changing api toml paths to make fly.io happy

* Changing api toml paths to make fly.io happy

* Still can't get fly.io to read the toml.  Moving back to where it started

* contract changes in changing vault params

* fixed lint errors

* params change in backend and scripts

* changes in operation script

* fixed upside vault params

* lint fix

* Interface refactoring (#54)

* icredbull removed

* refactored ICredbull structs

* removed ICredbull file

* added IErrors

* type changes in scripts

* new refactored changes

* notification service console logger

* resolved toml and readme conflicts

---------

Co-authored-by: Jonathan Lodge <[email protected]>
Co-authored-by: Ian Lucas <[email protected]>
@lucasia lucasia deleted the issue-37 branch August 14, 2024 15:18
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