Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
46376f7
initial commit
liobrasil Oct 29, 2025
dde1d0e
feat(cadence): add TidalEVMWorker contract to manage Tide positions f…
liobrasil Oct 29, 2025
ed4267a
chore(flow.json): remove deprecated contract entries to clean up the …
liobrasil Oct 30, 2025
6735259
feat(TidalEVMWorker): refactor beta badge handling to use capabilitie…
liobrasil Oct 30, 2025
7f134ba
feat(TidalEVMWorker): add logging for Tide creation and request statu…
liobrasil Oct 31, 2025
22812ab
chore(.gitignore): add cache, broadcast, and out directories to .giti…
liobrasil Nov 2, 2025
5155c39
feat(flow): update FlowTransactionScheduler hash for contract deployment
liobrasil Nov 2, 2025
7ddb427
chore(deploy_and_initialize.sh): update deployment script to ignore f…
liobrasil Nov 2, 2025
7e6d64f
chore(README.md): remove README file as it is no longer needed for th…
liobrasil Nov 2, 2025
9e34a2f
chore(setup_and_run_emulator.sh): enhance script to initialize Tidal …
liobrasil Nov 2, 2025
9f43b78
feat(docs): add README.md for Tidal EVM Integration with setup instru…
liobrasil Nov 2, 2025
c8a3311
chore(.gitignore): update .gitignore to ignore all .pkey files except…
liobrasil Nov 3, 2025
dbf4fb0
feat: rename TidalEVMWorker to TidalEVM for clarity and consistency a…
liobrasil Nov 4, 2025
62a7566
feat(ci): add Tide Creation CI workflow for end-to-end testing of tid…
liobrasil Nov 4, 2025
0b31abd
chore(tide_creation_test.yml): update GitHub Actions workflow to impr…
liobrasil Nov 4, 2025
d31bee8
feat(TidalEVM): add updateTidalRequestsAddress function to allow addr…
liobrasil Nov 5, 2025
14b0ebf
Replace tidal-sc submodule with flow-vaults-sc
liobrasil Nov 6, 2025
98cb3dc
Replace tidal by flow vaults
liobrasil Nov 6, 2025
3421938
Add transaction scheduler
liobrasil Nov 6, 2025
c6ea4a4
chore(transactions): remove setup_worker_existing_badge.cdc as it is …
liobrasil Nov 6, 2025
d7c79cd
fix(FlowVaultsEVM.cdc): update strategyIdentifier to the correct addr…
liobrasil Nov 6, 2025
4dea050
feat(cadence): add get_handler_stats and get_max_requests_config scri…
liobrasil Nov 6, 2025
d07b58f
feat(FlowVaultsEVM): increase gas limit for calls to improve transact…
liobrasil Nov 6, 2025
3848b26
chore(flow.json, setup_and_run_emulator.sh): update testnet alias and…
liobrasil Nov 7, 2025
2095f10
chore(tide_creation_test.yml): improve GitHub Actions workflow for Ti…
liobrasil Nov 7, 2025
521c412
Force update submodule
liobrasil Nov 7, 2025
2e11047
chore(setup_and_run_emulator.sh): update flow dependencies installati…
liobrasil Nov 7, 2025
4cb1b06
chore(flow-vaults-sc): add flow-vaults-sc as a subproject to manage d…
liobrasil Nov 7, 2025
fe9007e
Add emulator addresses
liobrasil Nov 7, 2025
b08841e
chore(.gitignore): remove emulator-account.pkey from version control …
liobrasil Nov 10, 2025
a5ec39e
chore: remove deprecated deploy_and_initialize.sh and setup_accounts.…
liobrasil Nov 12, 2025
7028ccf
chore(tide_creation_test.yml): simplify emulator setup by removing re…
liobrasil Nov 12, 2025
da102f8
chore(tide_creation_test): add sleep command to ensure emulator is re…
liobrasil Nov 12, 2025
cf8e088
chore(deploy_full_stack.sh): add verification for EVM Gateway readine…
liobrasil Nov 12, 2025
371d0bd
fix(tide_creation_test.yml): specify signer for process_requests tran…
liobrasil Nov 12, 2025
754cf11
feat(FlowVaultsEVM): add deposit and withdraw functions for Tide mana…
liobrasil Nov 12, 2025
3c99b77
feat(FlowVaultsEVM): add COA extraction and injection functionality t…
liobrasil Nov 12, 2025
be79438
chore(foundry.toml): remove optimizer settings and add fs_permissions…
liobrasil Nov 12, 2025
16a2dbb
feat(FlowVaultsTransactionHandler): add pause and unpause functionali…
liobrasil Nov 12, 2025
1240091
chore(check_worker_has_coa.cdc): remove unused script for checking wo…
liobrasil Nov 12, 2025
9af63ea
feat(FlowVaultsRequests): add custom errors for better error handling…
liobrasil Nov 12, 2025
8a5013c
feat(tide_creation): add vault and strategy identifiers to tide creat…
liobrasil Nov 12, 2025
67b2e01
chore: remove CreateTideRequest script and refactor FlowVaultsRequest…
liobrasil Nov 12, 2025
135b93b
feat(ci): add Tide Full Flow CI workflow to automate end-to-end testi…
liobrasil Nov 12, 2025
fabd4ca
docs(README.md): update script commands for creating and managing yie…
liobrasil Nov 12, 2025
8684949
refactor(FlowVaultsEVM): remove COA extraction and injection events a…
liobrasil Nov 12, 2025
a781adf
chore(tide_creation_test.yml, tide_full_flow_test.yml): update Foundr…
liobrasil Nov 12, 2025
536cc68
chore(workflows): update Foundry version from 1.4.3 to nightly for te…
liobrasil Nov 12, 2025
ff9592f
feat(workflows): add gas-limit parameter to transaction commands to p…
liobrasil Nov 12, 2025
edf86bd
chore(workflows): update Foundry version to nightly for consistency a…
liobrasil Nov 12, 2025
c53bedc
docs(README.md): update command examples for clarity and correctness …
liobrasil Nov 13, 2025
c2d1594
refactor: rename "whitelist" terminology to "allow list" for consiste…
liobrasil Nov 14, 2025
1b567ee
feat(FlowVaultsEVM.cdc): enhance error messages for better clarity an…
liobrasil Nov 14, 2025
b9ea917
feat(FlowVaultsEVM.cdc): add enums for RequestType and RequestStatus …
liobrasil Nov 14, 2025
12cae5e
chore(deploy_and_verify.sh): increase wait time from 30 to 60 seconds…
liobrasil Nov 14, 2025
18c4a8a
feat(FlowVaultsRequests): add minimum balance and maximum pending req…
liobrasil Nov 14, 2025
324da21
chore(.gitignore): add .secrets to .gitignore to prevent sensitive da…
liobrasil Nov 14, 2025
a67cf69
refactor(FlowVaultsRequests.sol): simplify tideId assignment logic to…
liobrasil Nov 14, 2025
4667289
chore(tide_creation_test.yml): update GitHub Actions workflow to inst…
liobrasil Nov 14, 2025
e00c8d5
chore(tide_creation_test.yml): remove unnecessary comments for clarit…
liobrasil Nov 14, 2025
7c31205
feat(tide_creation_test): add verification steps for tide creation in…
liobrasil Nov 14, 2025
44cec4b
fix(workflow): increase sleep duration from 60 to 80 seconds to ensur…
liobrasil Nov 14, 2025
7185829
ci: convert tide full flow test script to GitHub Actions workflow for…
liobrasil Nov 14, 2025
3515222
feat(e2e_test.yml): add new end-to-end integration test workflow for …
liobrasil Nov 14, 2025
b7fc0c5
chore(e2e_test.yml): increase sleep duration to 80 seconds to ensure …
liobrasil Nov 14, 2025
f903d9b
chore(e2e_test): improve comments and output messages for clarity in …
liobrasil Nov 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .cursorignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# flow
emulator-account.pkey
.env

# Pay attention to imports directory
!imports
204 changes: 204 additions & 0 deletions .github/workflows/e2e_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
name: Tide Operations CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
setup-and-test:
name: Tide Integration Tests
runs-on: ubuntu-latest
steps:
# === COMMON SETUP ===
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
submodules: recursive

- name: Install Flow CLI
run: sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)"

- name: Update PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Verify Flow CLI Installation
run: flow version

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Make scripts executable
run: |
chmod +x ./local/setup_and_run_emulator.sh
chmod +x ./local/deploy_full_stack.sh

- name: Setup and Run Emulator
run: |
./local/setup_and_run_emulator.sh &
sleep 80 # Wait for the emulator to be fully up

- name: Deploy Full Stack
run: |
DEPLOYMENT_OUTPUT=$(./local/deploy_full_stack.sh)
echo "$DEPLOYMENT_OUTPUT"
FLOW_VAULTS_REQUESTS_CONTRACT=$(echo "$DEPLOYMENT_OUTPUT" | grep "FlowVaultsRequests Contract:" | sed 's/.*: //')
echo "CONTRACT_ADDRESS=$FLOW_VAULTS_REQUESTS_CONTRACT" >> $GITHUB_ENV

# === TEST 1: BASIC TIDE CREATION ===
- name: Test 1 - Create Tide (10 FLOW)
run: |
echo "========================================="
echo "TEST 1: BASIC TIDE CREATION"
echo "========================================="
forge script ./solidity/script/FlowVaultsTideOperations.s.sol:FlowVaultsTideOperations \
--sig "runCreateTide(address)" ${{ env.CONTRACT_ADDRESS }} \
--rpc-url localhost:8545 \
--broadcast \
--legacy
env:
AMOUNT: 10000000000000000000

- name: Process Create Request
run: flow transactions send ./cadence/transactions/process_requests.cdc --signer tidal --gas-limit 9999

- name: Verify Tide Creation
run: |
echo "=== Verifying Tide Creation ==="

# Check tide details using the account-level script
TIDE_CHECK=$(flow scripts execute ./cadence/scripts/check_tide_details.cdc 0x045a1763c93006ca)
echo "$TIDE_CHECK"

# Verify that we have at least one EVM address with tides
if echo "$TIDE_CHECK" | grep -q '"totalEVMAddresses": 1'; then
echo "✅ EVM address registered"
else
echo "❌ No EVM addresses found"
exit 1
fi

# Verify that we have at least one tide created
if echo "$TIDE_CHECK" | grep -q '"totalMappedTides": 1'; then
echo "✅ Tide created successfully"
else
echo "❌ No tides found"
exit 1
fi

# Verify the specific EVM address has the tide
if echo "$TIDE_CHECK" | grep -q '6813eb9362372eef6200f3b1dbc3f819671cba69'; then
echo "✅ Tide mapped to correct EVM address"
else
echo "❌ EVM address mapping not found"
exit 1
fi

echo "✅ Test 1 Passed: Basic tide creation verified"

# === TEST 2: FULL TIDE LIFECYCLE ===
- name: Test 2 - Deposit Additional Funds (20 FLOW)
run: |
echo "========================================="
echo "TEST 2: FULL TIDE LIFECYCLE"
echo "========================================="
echo "Step 1: Depositing additional 20 FLOW..."
# Note: Using tide ID 0 based on the event logs from your output
forge script ./solidity/script/FlowVaultsTideOperations.s.sol:FlowVaultsTideOperations \
--sig "runDepositToTide(address,uint64)" ${{ env.CONTRACT_ADDRESS }} 0 \
--rpc-url localhost:8545 \
--broadcast \
--legacy
env:
AMOUNT: 20000000000000000000

- name: Process Deposit Request
run: flow transactions send ./cadence/transactions/process_requests.cdc --signer tidal --gas-limit 9999

- name: Verify Deposit
run: |
echo "Verifying deposit (should still have 1 tide with more balance)..."

TIDE_CHECK=$(flow scripts execute ./cadence/scripts/check_tide_details.cdc 0x045a1763c93006ca)
echo "$TIDE_CHECK"

# Should still have 1 tide
if echo "$TIDE_CHECK" | grep -q '"totalMappedTides": 1'; then
echo "✅ Still has 1 tide after deposit"
else
echo "❌ Tide count changed unexpectedly"
exit 1
fi

- name: Test 2 - Withdraw Half (15 FLOW)
run: |
echo "Step 2: Withdrawing 15 FLOW..."
forge script ./solidity/script/FlowVaultsTideOperations.s.sol:FlowVaultsTideOperations \
--sig "runWithdrawFromTide(address,uint64,uint256)" ${{ env.CONTRACT_ADDRESS }} 0 15000000000000000000 \
--rpc-url localhost:8545 \
--broadcast \
--legacy

- name: Process Withdraw Request
run: flow transactions send ./cadence/transactions/process_requests.cdc --signer tidal --gas-limit 9999

- name: Verify Withdrawal
run: |
echo "Verifying withdrawal (should still have 1 tide with less balance)..."

TIDE_CHECK=$(flow scripts execute ./cadence/scripts/check_tide_details.cdc 0x045a1763c93006ca)
echo "$TIDE_CHECK"

# Should still have 1 tide
if echo "$TIDE_CHECK" | grep -q '"totalMappedTides": 1'; then
echo "✅ Still has 1 tide after withdrawal"
else
echo "❌ Tide count changed unexpectedly"
exit 1
fi

- name: Test 2 - Close Tide
run: |
echo "Step 3: Closing tide (withdrawing remaining funds)..."
forge script ./solidity/script/FlowVaultsTideOperations.s.sol:FlowVaultsTideOperations \
--sig "runCloseTide(address,uint64)" ${{ env.CONTRACT_ADDRESS }} 0 \
--rpc-url localhost:8545 \
--broadcast \
--legacy

- name: Process Close Request
run: flow transactions send ./cadence/transactions/process_requests.cdc --signer tidal --gas-limit 9999

- name: Verify Tide Closed
run: |
echo "Verifying tide was closed..."

TIDE_CHECK=$(flow scripts execute ./cadence/scripts/check_tide_details.cdc 0x045a1763c93006ca)
echo "$TIDE_CHECK"

# After closing, should have 0 tides or the tide should be marked as closed
if echo "$TIDE_CHECK" | grep -q '"totalMappedTides": 0'; then
echo "✅ Tide successfully closed and removed"
elif echo "$TIDE_CHECK" | grep -q '"totalEVMAddresses": 0'; then
echo "✅ No more active tides for EVM addresses"
else
echo "⚠️ Tide may still exist but should be in closed state"
# Don't fail here as the close transaction succeeded
fi

echo "✅ Test 2 Passed: Full tide lifecycle completed"

# === FINAL SUMMARY ===
- name: Test Summary
run: |
echo "========================================="
echo "ALL INTEGRATION TESTS PASSED"
echo "========================================="
echo "✅ Test 1: Basic Tide Creation - PASSED"
echo "✅ Test 2: Full Tide Lifecycle - PASSED"
echo "========================================="
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
imports
db

.env
.secrets

# Cache files
cache/
broadcast/

# Build output
out/
9 changes: 6 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "lib/tidal-sc"]
path = lib/tidal-sc
url = https://github.com/onflow/tidal-sc.git
[submodule "lib/flow-vaults-sc"]
path = lib/flow-vaults-sc
url = https://github.com/onflow/FlowVaults-sc.git
[submodule "solidity/lib/forge-std"]
path = solidity/lib/forge-std
url = https://github.com/foundry-rs/forge-std
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"wake.compiler.solc.remappings": []
}
Loading