Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
54123f8
test: add MockUSDC with 6 decimals for realistic testing
katyailil Dec 4, 2025
11a6b0f
test: SplitBaseV1 initialization and pool management
katyailil Dec 4, 2025
3c52019
test: add comprehensive test coverage for RegistryV1 and ExecutorV1
katyailil Dec 4, 2025
0d6f839
chore: configure gas reports and fuzz settings
katyailil Dec 4, 2025
da1e893
fix: correct OpenZeppelin proxy import paths and remappings
katyailil Dec 4, 2025
099856f
fix: adjust ExecutorV1 tests for correct authorization flow
katyailil Dec 4, 2025
9172b24
chore: update foundry.lock with dependency resolution
katyailil Dec 4, 2025
7f58637
feat: add domain model types for bucket and source semantics
katyailil Dec 10, 2025
0e2a593
feat: define ISplitBaseV2 interface with bucket-aware operations
katyailil Dec 10, 2025
9f8992e
refactor: change function visibility from external to public
katyailil Dec 10, 2025
d744467
feat: implement SplitBaseV2 with bucket semantics and source tracking
katyailil Dec 10, 2025
51e3d3a
test: add comprehensive SplitBaseV2 test coverage
katyailil Dec 10, 2025
28f22f9
docs: add architecture and domain model documentation
katyailil Dec 10, 2025
48fdde4
docs: update README with V2 features and documentation links
katyailil Dec 10, 2025
1eeda3c
feat: add UpgradeToV2 deployment script
katyailil Dec 10, 2025
ea3ce51
ci: update upgrade workflow for SplitBaseV2 deployment
katyailil Dec 10, 2025
9284365
fix: resolve console.log compilation error in UpgradeToV2 script
katyailil Dec 10, 2025
412efba
chore: update deployment records with V2 implementation addresses
katyailil Dec 10, 2025
ce8087c
feat: make upgrade workflow universal for all contracts
katyailil Dec 10, 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
58 changes: 48 additions & 10 deletions .github/workflows/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,24 @@ name: Upgrade Contracts
on:
workflow_dispatch:
inputs:
contract:
description: 'Contract to upgrade'
required: true
type: choice
options:
- SplitBase
- Registry
- Executor
network:
description: 'Network (same as deployment)'
description: 'Network'
required: true
type: choice
options:
- base_sepolia
- base
proxy_address:
description: 'Proxy contract address (not implementation!)'
required: true
description: 'Proxy contract address (optional - auto-detected from deployments/)'
required: false

jobs:
upgrade:
Expand All @@ -25,22 +33,52 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Deploy new implementation
- name: Determine proxy address
id: proxy
run: |
CHAIN_ID=${{ inputs.network == 'base' && '8453' || '84532' }}
CONTRACT_LOWER=$(echo "${{ inputs.contract }}" | tr '[:upper:]' '[:lower:]')

if [ -n "${{ inputs.proxy_address }}" ]; then
PROXY="${{ inputs.proxy_address }}"
else
PROXY=$(jq -r ".${CONTRACT_LOWER}Proxy" deployments/${CHAIN_ID}.json)
fi

echo "proxy_address=$PROXY" >> $GITHUB_OUTPUT
echo "📍 Proxy address: $PROXY"

- name: Upgrade contract
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
BASESCAN_API_KEY: ${{ secrets.BASESCAN_API_KEY }}
PROXY_ADDRESS: ${{ inputs.proxy_address }}
PROXY_ADDRESS: ${{ steps.proxy.outputs.proxy_address }}
run: |
echo "Deploying new implementation..."
forge script script/DeployProxy.s.sol \
echo "🚀 Upgrading ${{ inputs.contract }}..."
echo "Network: ${{ inputs.network }}"
echo "Proxy: $PROXY_ADDRESS"

case "${{ inputs.contract }}" in
SplitBase)
SCRIPT="script/UpgradeToV2.s.sol"
;;
Registry)
SCRIPT="script/Upgrade.s.sol"
;;
Executor)
SCRIPT="script/Upgrade.s.sol"
;;
esac

forge script $SCRIPT \
--rpc-url ${{ inputs.network }} \
--broadcast \
--verify \
-vvvv

echo "⚠️ Manual upgrade required:"
echo "Call upgradeToAndCall() on proxy at $PROXY_ADDRESS"
echo "with new implementation address from deployment"
echo ""
echo "✅ Upgrade complete!"
echo "Proxy $PROXY_ADDRESS upgraded successfully"

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,26 @@ High-precision share calculations ensure accurate distribution across all recipi
## Architecture

- **Core Pool Logic**: Dynamic recipient configurations with percentage/unit-based shares
- **Bucket Semantics**: Structured categorization (TEAM, INVESTORS, TREASURY, etc.)
- **Source Tracking**: Revenue attribution (Base Pay, protocol fees, grants, etc.)
- **Registry**: Centralized pool management and discovery
- **Executor**: Base Pay integration for automated execution flows
- **Upgradeability**: UUPS proxy pattern with static addresses

**📚 Documentation:**
- [Architecture Guide](./docs/ARCHITECTURE.md) - Technical architecture and integration patterns
- [Domain Model](./docs/DOMAIN_MODEL.md) - Business concepts explained for non-developers

## Features

- Create and manage payout pools with flexible share models
- **Bucket categorization** (TEAM, INVESTORS, TREASURY, REFERRALS, SECURITY_FUND, GRANTS)
- **Revenue source tracking** (Base Pay, protocol fees, grants, donations, partnerships)
- **Distribution history** with full on-chain audit trail
- Execute distribution cycles with precise accounting
- Support for Base smart wallets and sub-accounts
- Full upgradeability without address changes
- Event emissions optimized for Subgraph indexing
- Full upgradeability without address changes (V1 → V2 compatible)
- Event emissions optimized for Subgraph indexing and analytics dashboards
- Gas-optimized execution for cost-effective operations

## Development
Expand Down
5 changes: 4 additions & 1 deletion deployments/8453.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"network": "base",
"registryImplementation": "0x4125d418Fe36a755F5eEB7c502ca3e00750cDDd8",
"registryProxy": "0xEa10580212A12c98eE0ebACbBC595af2062a81B0",
"splitBaseImplementation": "0xC680FA2Ba45f01B84E7962cBbe8cDc98dD20Ad72",
"splitBaseImplementation": "0x13A8f49C41133A2f3D5E6cbb18626EE242b0E4f4",
"splitBaseImplementationV1": "0xC680FA2Ba45f01B84E7962cBbe8cDc98dD20Ad72",
"splitBaseProxy": "0x9A1f27779561269Ac8bFFdd152D1F8f2C445FC3e",
"version": "V2",
"upgradedAt": 1733845200,
"timestamp": 1764058313
}
5 changes: 4 additions & 1 deletion deployments/84532.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"network": "base-sepolia",
"registryImplementation": "0x34aec145B7b2a0922112545C8D9bC20bd551F901",
"registryProxy": "0xF0f141DeB225D9D4639dF1E6E91bE4bC90EDD5eE",
"splitBaseImplementation": "0xc41b9c958109ebcD0Ff3794C30D4d151490a2975",
"splitBaseImplementation": "0x2Ca555A7ACFE2da02099A6d950b8665A65f5c861",
"splitBaseImplementationV1": "0xc41b9c958109ebcD0Ff3794C30D4d151490a2975",
"splitBaseProxy": "0x62B52D21db12E4A709a49c043e31adfdAB41FB39",
"version": "V2",
"upgradedAt": 1733845200,
"timestamp": 1764058302
}
Loading