-
Notifications
You must be signed in to change notification settings - Fork 1
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
Re-structuring and renaming of contracts code. #71
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…. This is for review.
Use the `export function` syntax in all places, where possible.
…ality itself. Invocation point is irrevelant.
This reverts commit 4977f42.
* 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]>
Updated deposit use case to be more reason-able!
Also be clearer in function
Re-worked all the use cases to use the description functions, to log the 'story' of the use case.
Updated all usages to the simplified notation.
Fixed a test description typo.
…ult` to `FixedYieldVault`.
… there function better.
…nMaturity`. Updated the vault tests to reflect the changes.
Re-structuring and renaming of contracts code.
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
jplodge-pro
changed the title
A cleaner version.
Re-structuring and renaming of contracts code.
Jul 2, 2024
typo fix in package.json
…o `contracts`. Some database migration outstanding.
Fixed imports.
Added FIXME and console logging for function that was consistently throwing errors.
This reverts commit 78903a9.
… be white listed.
Updates to all components enforced by restructuring of `contracts`.
Krishnakumarskr
approved these changes
Jul 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE: This PR is #66 ff-merged to give a cleaner change profile.
Reason
This is a quick change to address some of the issues I have with the
contracts
codebase, like:CredbullBaseVault
the root of the Vault contract hierarchy.Credbull
, but not actually deployed (the only other 'Credbull' prefixed contracts are those that are deployed).Base
, but is that really necessary? Also, in that vein, it could beBaseMaturityVault
.MockToken
andMockStableCoin
intest
, but alsoCredbullBaseVaultMock
(same for all vaults).whitelist
andkyc
used interchangeably.WindowPlugIn
is it amature
window, or aredemption
window? Seeing as the other window is thedeposit
window, it seems to me that it should beredemption
. But it's ISmature
and is referenced interchangeably as 'mature' and 'redemption'.base
,vaults
ANDextensions
fulfilling essentially the same purpose.interface
containing cross-functional interfaces.IErrors
has been deletedsrc
) containing deployable contracts ANDfactories
Adopted Changes
vault
andfactory
.src
directory.PlugIn
are now re-namedPlugin
.XParams
struct
capturing their construction values.XParams
contains a reference to anotherXParams
, the member name isx
.params.maturityVault.vault.custodian;
, whereparams
is aFixedYieldVaultParams
. Thus the purpose is clear due to the call chain offparams
and no need to have anxParams
at every level of the tree.matureWindow
inWindowPlugIn
toredemptionWindow
.WindowPlugin
relates to deposit/redemption windows.MaturityVault
is a Vault that 'pushes' the assets to the depositing accounts on maturation. BUT it should not know anything ofpromisedYield
orfixedYield
as those areFixedYieldVault
concerns._fixedYield
toFixedYieldVault
.expectedAssetsOnMaturity
to bevirtual
and to have a simple implementation.SimpleX
..t.sol
files. We had.m.sol
and.sol
files intest
.remappings.txt
import
from"@credbull/..."
forsrc
,"@script/..."
forscript
code and"@test/..."
for `test code.test
andscript
source (where the '../../..' imports are prevalent).Extent
contracts
. #72) for all knock-on effects has been merged into this PR.