Skip to content

Release: develop -> main#3259

Merged
davidleomay merged 2 commits intomainfrom
develop
Feb 25, 2026
Merged

Release: develop -> main#3259
davidleomay merged 2 commits intomainfrom
develop

Conversation

@github-actions
Copy link

Automatic Release PR

This PR was automatically created after changes were pushed to develop.

Commits: 1 new commit(s)

Checklist

  • Review all changes
  • Verify CI passes
  • Approve and merge when ready for production

…3243)

* feat: route REALU sell through BrokerBot via atomic EIP-7702 batch

DFX must never receive REALU tokens. Instead of sending REALU directly
to a DFX deposit address, the sell flow now routes through the BrokerBot:
User -> REALU -> BrokerBot -> ZCHF -> DFX Deposit

The atomic batch uses redeemDelegations with two calls:
1. transferAndCall (ERC-677): REALU to BrokerBot (triggers sell)
2. transfer (ERC-20): ZCHF to DFX deposit address

Changes:
- Add getBrokerbotSellPrice(), getBrokerbotAddress(), getZchfAddress()
  to RealUnitBlockchainService
- Add executeBrokerBotSellForRealUnit() to Eip7702DelegationService
  with batch encoding for two calls in one atomic TX
- Update confirmSell() in RealUnitService to use BrokerBot flow
- Add unit tests (32 tests) for price calculation and batch encoding
- Add Sepolia test contracts (TestREALU, TestZCHF, TestBrokerBot)
  and E2E test script verified on Sepolia (TX success)
- Add platform: linux/amd64 to docker-compose.yml for Apple Silicon

NOTE: realunit-blockchain.service.ts currently has Sepolia test contract
addresses. Must revert to mainnet addresses before production merge.

* feat: replace hardcoded contract addresses with dynamic resolution

- Remove hardcoded BROKERBOT, REALU, ZCHF Sepolia addresses from
  realunit-blockchain.service
- Resolve REALU and ZCHF addresses from asset DB via tokenBlockchain
  (Sepolia for DEV/LOC, Ethereum for PRD)
- Resolve BrokerBot address from config, environment-aware
- Add ZCHF Sepolia asset migration
- Pass addresses as parameters to getBrokerbotInfo()

* fix: prettier formatting

* fix: remove unused imports in test-brokerbot-sell and migration

* fix: move hardcoded keys to env vars in test scripts

* fix: remove test-contracts from tracking (already in .gitignore)

* fix: replace authorization: any with typed Eip7702Authorization interface

* fix: redeploy BrokerBot with correct REALU/ZCHF Sepolia addresses

* fix: deploy real Aktionariat Brokerbot on Sepolia with correct token addresses

* fix: redeploy ZCHF + BrokerBot on Sepolia with correct token naming

Replace tZCHF (Test Frankencoin) with properly named Frankencoin (ZCHF)
contract and redeploy BrokerBot with new base currency address.

* test: add unit tests for getBrokerbotInfo and confirmSell

Add 4 tests to realunit-blockchain.service.spec.ts covering the new
getBrokerbotInfo signature (address passthrough, price, buyingEnabled,
sellingEnabled).

Create realunit.service.spec.ts with 9 tests covering PR-changed
methods: getBrokerbotInfo (asset resolution + delegation to blockchain
service) and confirmSell (EIP-7702 flow, manual txHash, error cases).

* fix: remove unused NotFoundException import in realunit.service.spec

* fix: move test script to scripts/ and make migration idempotent

- Move test-brokerbot-sell.js from repo root to scripts/
- Add IF NOT EXISTS guard to AddSepoliaZCHF migration to prevent
  duplicate insert failures on re-run

* refactor: remove unused transferTokenWithUserDelegationForRealUnit

Dead code — replaced by executeBrokerBotSellForRealUnit in the
BrokerBot sell flow. No callers remain.

* chore: remove unrelated docker-compose change and dev test script

Remove platform: linux/amd64 from docker-compose.yml (unrelated to
BrokerBot feature) and remove scripts/test-brokerbot-sell.js (manual
E2E dev tool, not production code).

* feat: use correct brokerbot for sellPrice for testnet and mainnet.

* chore: handling sell price when zero.

* test: fix realunit service test.

---------

Co-authored-by: TuanLamNguyen <xnguyen.lam@gmail.com>
* feat: added Scrypt deposit requests

* fix: format
@davidleomay davidleomay merged commit 70810de into main Feb 25, 2026
12 checks passed
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.

2 participants