-
Notifications
You must be signed in to change notification settings - Fork 0
[DO NOT MERGE] Review current contracts #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
base: gio/pr-base
Are you sure you want to change the base?
Conversation
sisyphusSmiling
commented
Nov 18, 2025
…or EVM users and facilitate requests from EVM side feat(cadence): create fund_evm_from_coa transaction to transfer FLOW from Cadence account to EVM address feat(cadence): implement setup_coa transaction to initialize Cadence Owned Account (COA) for EVM interactions chore(flow.json): remove deprecated EVM bridge references to clean up configuration feat(solidity): add CreateTideRequest script for creating tide requests on EVM side feat(solidity): implement DeployTidalRequests script for deploying TidalRequests contract docs(txns.txt): document transaction steps for setting up COA, funding EVM accounts, and deploying contracts
…flow configuration and improve maintainability
…s instead of references for improved security and flexibility feat(TidalEVMWorker): add logging for request processing details to enhance traceability feat(TidalEVMWorker): implement proper conversion between UFix64 and attoflow for accurate fund transfers feat(TidalEVMWorker): create new scripts for checking user tides and processing requests to streamline operations fix(TidalRequests): change function visibility from public to internal to restrict access and enhance contract security chore(txns.txt): update transaction instructions for clarity and organization in deployment steps
…s updates to improve traceability feat(TidalRequests): implement getPendingRequestsUnpacked function to return request data in a more accessible format fix(TidalEVMWorker): correct amount conversion logic in ufix64FromUInt256 function for accurate calculations fix(CreateTideRequest): update AMOUNT constant to reflect the correct deposit value for testing fix(txns.txt): correct funding transaction amount for userA to ensure proper funding
…gnore to prevent unnecessary files from being tracked fix(.gitmodules): update submodule URL for tidal-sc to point to the correct repository FlowVaults-sc
feat(scripts): add deployment and initialization scripts for TidalRequests contract feat(scripts): add full stack deployment script for easier setup feat(scripts): add account setup script for funding and configuring accounts feat(scripts): add script to setup and run Flow emulator with EVM gateway
…ailures for already-deployed Cadence contracts chore(txns.txt): remove outdated transaction instructions and EVM addresses to clean up the repository
…submodule and clean up existing processes on required ports feat(setup_and_run_emulator.sh): make address and port variables configurable with default values to improve flexibility chore(setup_and_run_emulator.sh): add flow dependencies installation step to ensure all required dependencies are present before starting the emulator
…ctions and architecture overview
… emulator-account.pkey for better security feat(flow.json): add TidalEVMWorker contract and update aliases for TidalYield and TidalYieldClosedBeta to include testnet chore(setup_and_run_emulator.sh): call setup_wallets.sh in the emulator setup script to ensure wallets are created before running the emulator
…cross documentation and codebase refactor: update references to TidalEVMWorker in contracts, transactions, and scripts to TidalEVM for improved readability and maintainability fix: adjust comments and documentation to reflect the new naming convention and clarify the purpose of the TidalEVM contract
…e creation process This workflow automates the testing of the tide creation process by setting up the environment, deploying contracts, and processing requests. It ensures that changes to the main branch are validated through integration tests.
…ove installation steps and add PATH update for Flow CLI
…ess updates feat(TidalRequests): implement cancelRequest function for user-initiated cancellations fix(TidalRequests): update request status handling to use uint8 for status feat(scripts): add various scripts for checking COA, pending requests, and storage feat(scripts): create detailed status checks for TideManager and contract state chore(scripts): implement get_request_details and get_contract_state scripts for better diagnostics
…no longer needed chore(flow.json): update contract sources and hashes to point to testnet for deployment consistency
…ess for TracerStrategy fix(flow.json): update testnet alias to the correct address for FlowVaults and FlowVaultsClosedBeta
…pts to provide statistics and configuration insights for FlowVaultsTransactionHandler and FlowVaultsEVM
…ion success rates fix(FlowVaultsTransactionHandler): rename function to getPendingRequestIdsFromEVM for clarity feat(FlowVaultsTransactionHandler): implement auto-scheduling of next execution after processing feat(FlowVaultsTransactionHandler): add function to schedule next execution based on workload chore: replace deprecated get_handler_stats script with NOT_WORKING_get_handler_stats script feat(FlowVaultsRequests): add new contract for request queue and fund escrow for EVM users fix(schedule_initial_flow_vaults_execution): update recommended execution effort for safety chore: remove old get_handler_stats script to clean up codebase
… hashes in flow.json and enhance cleanup script in setup_and_run_emulator.sh for better maintenance and clarity
…de creation tests by adding emulator readiness checks and cleanup steps feat(tide_creation_test.yml): add steps to verify Flow CLI installation and make scripts executable before running the emulator fix(tide_creation_test.yml): update path for local bin and ensure proper cleanup of processes after tests
…on command to skip alias and deployments for faster setup
…ependencies more effectively
…to enhance security chore(flow.json): update emulator addresses to mainnet addresses for deployment accuracy chore(deploy_and_initialize.sh): add optimization flags for contract deployment to improve efficiency chore(setup_and_run_emulator.sh): simplify cleanup logic and remove unnecessary directory creation chore(foundry.toml): enable optimizer and set runs for better contract deployment efficiency feat(README.md): update process request command to include signer option for clarity fix(FlowVaultsEVM.cdc): update strategy identifier to correct address for consistency feat(check_public_coa.cdc): add new script to check public COA capabilities for accounts fix(flow.json): update emulator alias to correct address for consistency chore(deploy_and_initialize.sh): remove error handling for contract deployment to streamline process fix(setup_accounts.sh): remove COA setup command as it is no longer needed chore(setup_and_run_emulator.sh): add cleanup for imports directory and install dependencies automatically fix(DeployFlowVaultsRequests.s.sol): update COA address to correct address for deployment feat(FlowVaultsEVM.cdc): enhance error handling for EVM calls by decoding error messages and panicking with detailed information refactor(FlowVaultsEVM.cdc): remove assert statements for EVM call results and replace them with conditional checks that decode errors for better debugging and clarity feat(get_coa_address.cdc): update COA address retrieval to use EVM storage path for better accuracy feat(get_worker_coa_address.cdc): add new script to retrieve COA address from worker storage chore(deploy_and_initialize.sh): extract COA address from script execution and export it for use chore(setup_and_run_emulator.sh): streamline emulator setup by removing hardcoded addresses and using environment variables chore(DeployFlowVaultsRequests.s.sol): read COA address from environment variable for flexibility in deployment feat(scripts): add run_transaction_handler.sh to initialize and schedule transactions for Flow Vaults EVM Bridge
…ty to control transaction execution flow feat(check_handler_paused): create script to check if the transaction handler is paused feat(pause_transaction_handler): implement transaction to pause the automated transaction handler feat(unpause_transaction_handler): implement transaction to unpause the automated transaction handler chore(deploy_testnet_full_stack): add full stack deployment script for Flow Testnet chore(flow.json): update contract addresses for FlowVaultsEVM and FlowVaultsTransactionHandler in testnet configuration
…rker COA to clean up the codebase
… and clarity in contract logic feat(FlowVaultsRequests): implement whitelist functionality to control access to certain functions feat(FlowVaultsRequests): add events for whitelist changes and request processing to improve transparency refactor(FlowVaultsRequests): replace require statements with custom errors for gas efficiency and clarity test(FlowVaultsRequests): add tests for new whitelist functionality and custom error handling test(FlowVaultsRequests): enhance existing tests to cover new features and ensure contract integrity
…ion process for better tracking and management refactor(tide_creation): update tide creation script to use new identifiers and improve clarity chore(tide_creation): remove deprecated get_handler_stats script to clean up the codebase fix(flow.json): add testing alias for FlowVaults contracts to support local testing environment feat(FlowVaultsRequests): enhance request structure to include vault and strategy identifiers for better context in requests
…s contract to simplify request handling and improve code clarity - Delete the CreateTideRequest script as it is no longer needed. - Remove user request history mapping and related functions to streamline the contract. - Update event definitions to remove indexed parameters for better performance. - Refactor loops to use unchecked increments for gas optimization. - Introduce a new internal function `_validateDeposit` to encapsulate deposit validation logic.
…ng of tide lifecycle feat(tide): create test script for complete tide flow end-to-end testing with detailed steps and outputs
…ld positions to reflect new script structure and provide detailed usage examples fix(flow.json): update testnet address and private key to the correct values for deployment
…nd functions to simplify contract logic refactor(FlowVaultsEVM): change COA parameter to a capability for better security and access control refactor(FlowVaultsTideOperations): update function signatures to accept contract address as a parameter for flexibility chore(deploy_full_stack.sh): improve deployment script to extract contract address dynamically and provide feedback chore(setup_and_run_emulator.sh): streamline emulator and EVM Gateway setup process for better clarity and efficiency chore: remove unused scripts related to COA extraction and injection to clean up the codebase
…y version to 1.4.3 for consistency across workflows feat(tide_creation_test.yml, tide_full_flow_test.yml): modify deployment scripts to capture and set CONTRACT_ADDRESS in GitHub environment for subsequent steps refactor(tide_creation_test.yml, tide_full_flow_test.yml): update function signatures in tide operations to include address parameter for better clarity and functionality
…sting improvements in CI workflows
…revent potential out-of-gas errors during execution chore(scripts): update transaction commands in deployment scripts to include gas-limit for consistency and reliability
…cross workflows fix(test_tide_full_flow.sh): change TIDE_ID from 1 to 0 to reflect valid first tide feat(test_tide_full_flow.sh): add contract address check for FLOW_VAULTS_REQUESTS_CONTRACT fix(test_tide_full_flow.sh): update function signatures to accept contract address fix(test_tide_full_flow.sh): add gas limit to flow transactions for better reliability fix(FlowVaultsTideOperations): remove tide ID validation for deposit, withdraw, and close operations fix(FlowVaultsRequests): remove tide ID validation to allow for tide ID 0 test(FlowVaultsRequestsTest): update tests to validate tide ID 0 as a valid case for deposits
…by adding <CONTRACT_ADDRESS> and correcting gas limit typo
…ncy and clarity across the codebase feat: implement balance conversion function from UFix64 to EVM.Balance for better handling of token amounts in the FlowVaultsEVM contract fix: update error messages and function names to reflect the new "allow list" terminology in the FlowVaultsRequests contract and its tests
…d debugging feat(FlowVaultsEVM.cdc): implement getUserBalanceFromEVM function to retrieve user balance from EVM contract fix(FlowVaultsEVM.cdc): adjust gas limits for EVM calls to optimize performance fix(FlowVaultsEVM.cdc): update user balance logic to subtract amounts instead of setting to zero
…to improve code readability and maintainability fix(FlowVaultsEVM.cdc): update request status handling to use enums for clarity fix(FlowVaultsEVM.cdc): increase gas limits for contract calls to prevent out-of-gas errors
… for block explorer indexing to ensure successful verification
…uests features to enhance user request management feat(FlowVaultsRequests): implement tide ID validation and ownership tracking for improved request integrity fix(FlowVaultsRequests): update request cancellation and processing logic to correctly manage user pending request counts test(FlowVaultsRequests): create test helper contract to facilitate tide ID registration for testing purposes
…ta exposure refactor(FlowVaultsEVM.cdc): remove PROCESSING status from RequestStatus enum to simplify request handling refactor(FlowVaultsRequests.sol): remove PROCESSING status from RequestStatus enum to streamline status management refactor(get_request_details.cdc): update statusName logic to reflect removal of PROCESSING status refactor(FlowVaultsRequests.t.sol): remove references to PROCESSING status in tests to align with updated logic
… always update tideId for clarity and consistency
…all required tools only for local testing and remove unnecessary cleanup steps
…y and update sleep duration for emulator setup fix(tide_creation_test.yml): correct RPC URL format to include http protocol for proper connectivity
… workflow to ensure successful deployment and mapping of tides to EVM addresses
…e emulator is fully set up before proceeding with deployment
… CI integration and automation of end-to-end testing
…Tide operations to ensure functionality and reliability of the Tide lifecycle chore(tide_creation_test.yml): remove outdated tide creation test workflow as it is now integrated into the new e2e_test.yml chore(tide_full_flow_test.yml): remove obsolete full flow test workflow as its functionality is covered in the new e2e_test.yml
…emulator is fully up before proceeding
…the e2e test workflow refactor(e2e_test): update tide ID references to use 0 instead of 1 for consistency in the test cases refactor(e2e_test): streamline tide verification logic to enhance readability and maintainability
| ) | ||
|
|
||
| // Validate the estimate | ||
| assert( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure we want to revert or throw an error event here - feels inconsistent to the downstream safe processing approach. Same goes for successive points of failure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understood the whole philosophy of graceful failure. Will rethink those parts in this view.
|
|
||
| // Create and save Admin resource | ||
| let admin <- create Admin() | ||
| self.account.storage.save(<-admin, to: self.AdminStoragePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious why we don't initialize the Handler in contract init. Seems we'd want to configure any dependencies required for scheduling including the Worker and the FlowTransactionSchedulerUtils.Manager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more about decoupling the contract. We could initialize it here taking into account that the worker is of course already created
|
|
||
| access(all) resource Worker { | ||
| access(self) let coaCap: Capability<auth(EVM.Call, EVM.Withdraw) &EVM.CadenceOwnedAccount> | ||
| access(self) let tideManager: @FlowVaults.TideManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's an argument for the TideManager to be stored in a more distributed manner in account storage. The potential issue I see with a single central TideManager is that one user's actions can potentially impact the accessibility of all EVM-initiated Tides - a spammer's actions more directly impacts global state. The other issue is that you have to use custom scripts to query for TideManager data.
An architectural approach to address this concern could be to store a TideManager at a derived path - say /storage/FlowVaultsEVM_<USER_ADDRESS>_<TIDE_ID> which can be easily derived by EVMRequest values.
Alternatively, if we decide a single TideManager is preferable, I still think storing the TideManager in storage and take a Capability to it would be closer to ideal than nesting the resource - again, because it absolves the need for custom scripts to query state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the path, you mean /storage/FlowVaultsEVM_<USER_ADDRESS> right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having one tideManager per user makes sense from an architectural perspective. This approach provides cleaner separation of concerns and clearly delineates ownership at the resource level.
Need to think about tideManagers management (creation, deletion) according to user's interaction however.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the path, you mean /storage/FlowVaultsEVM_<USER_ADDRESS> right ?
Yes, my mistake - that's right