Merged
Conversation
This reverts commit a17586b.
… restart (#793) Changed #ifndef to #if ! so that loadContractExecFeeFiles() is called when START_NETWORK_FROM_SCRATCH is 0 (node joining existing network). The #ifndef check always skipped loading because the macro is always defined, causing misalignment after epoch transition.
The new release of contract-verify checks that contracts do not define direct member variables in the contract struct. They all need to be defined in the nested StateData struct.
* Add VottunBridge smart contract for cross-chain bridge functionality
* Compilation fixes
* Fixed compilation errors
* Update VottunBridge.h
* Compilation working
* feat: Add VottunBridge smart contract with comprehensive test suite
- Implement bidirectional bridge between Qubic and Ethereum
- Add 27 comprehensive tests covering core functionality
- Support for order management, admin functions, and fee handling
- Include input validation and error handling
- Ready for deployment and IPO process
* Address reviewer feedback: clean up comments, optimize functions, fix division operators
- Remove duplicate and Spanish comments from VottunBridge.h
- Clean up 'NEW'/'NUEVA' comments throughout the code
- Optimize isAdmin and isManager functions (remove unnecessary locals structs)
- Replace division operators with div() function for fee calculations
- Add build artifacts to .gitignore
- Fix syntax errors and improve code consistency
* Address additional reviewer feedback: optimize getAdminID function and clean up build artifacts
- Remove empty getAdminID_locals struct and use PUBLIC_FUNCTION macro
- Remove versioned build/test artifacts from repository
- Clean up remaining comments and code optimizations
- Fix division operators to use div() function consistently
* Fix isManager function: use WITH_LOCALS for loop variable
- Refactor isManager to use PRIVATE_FUNCTION_WITH_LOCALS
- Move loop variable 'i' to isManager_locals struct
- Comply with Qubic rule: no local variables allowed in functions
- Address Franziska's feedback on loop variable requirements
* Fix VottunBridge refund security vulnerability KS-VB-F-01
- Add tokensReceived and tokensLocked flags to BridgeOrder struct
- Update transferToContract to accept orderId and set per-order flags
- Modify refundOrder to check tokensReceived/tokensLocked before refund
- Update completeOrder to verify token flags for consistency
- Add comprehensive security tests validating the fix
- Prevent exploit where users could refund tokens they never deposited
Tests added:
- SecurityRefundValidation: Validates new token tracking flags
- ExploitPreventionTest: Confirms original vulnerability is blocked
- TransferFlowValidation: Tests complete transfer flow security
- StateConsistencyTests: Verifies state counter consistency
All 24 tests pass successfully.
* Fix code style formatting for security tests
- Update TEST_F declarations to use braces on new lines
- Fix struct declarations formatting
- Fix if statement brace formatting
- Comply with project code style guidelines
* Fix VottunBridge code style and PR review issues
- Remove all 'NEW' comments from functions and procedures
- Fix char literal '\0' to numeric 0 in EthBridgeLogger
- Keep underscore variables (_tradeFeeBillionths, _earnedFees, etc.) as they follow Qubic standard pattern
- All opening braces { are now on new lines per Qubic style guidelines
* Removed coment
* last fix
* Fixed order in createOrder_input
* update
* fix for testnet
* admin addresess update
* update on addresses
* update in admins
* update in proposals arry
* update
* epoch update
* sc update
* update in order status return
* Refactor fee accumulation and order handling in VottunBridge. Fees are now accumulated only after successful order creation and refunds include both the order amount and fees. Improved slot management for proposals and added checks for multisig admin verification.
* update for compiler
* Refactor VottunBridge error handling to use enumerated error codes for insufficient transaction fees. Update test cases to validate fee requirements and proposal management, ensuring proper state transitions and error responses.
* Implement cancelProposal functionality in VottunBridge, allowing proposal creators to cancel their proposals. Update cleanup logic to handle both executed and inactive proposals. Adjust token locking mechanism to refund excess amounts sent by users. Register cancelProposal procedure in the contract.
* Enhance VottunBridge contract by defining new contract index and state types. Implement setProposalById and cancelProposal methods in the testing framework. Update test cases to validate proposal management and token refund mechanisms. Adjust project configuration to include necessary directories for testing.
* Refactor fee calculation and refund logic in VottunBridge to include underflow protection. Introduce separate variables for operator and network fees, ensuring only available fees are refunded. Update available fees calculations in multiple functions for consistency and safety.
* Enhance VottunBridge contract by adding security checks to prevent duplicate admins and managers during proposal processing. Update logic to ensure that existing addresses are not replaced or added again, maintaining the integrity of the admin and manager lists.
* Add VOTTUN contract to ContractDescription in contract_def.h
* Update VOTTUN contract details in ContractDescription to reflect new proposal and IPO epochs
* Update EPOCH definition in public_settings.h to reflect new startup configuration
* Update EPOCH value in public_settings.h to 199 for node startup configuration
* Refactor proposal management in VottunBridge contract to utilize a dedicated slot index for storing new proposals. This change improves clarity and ensures the correct slot is used when setting proposals, enhancing overall contract functionality.
* Add manager count tracking in VottunBridge contract to enforce manager limit. Implement checks to prevent adding more than three managers during proposal processing, enhancing contract security and integrity.
* Add reserved fees tracking in VottunBridge contract to manage pending orders. Implement logic to reserve and release fees for completed orders and refunds, enhancing fee management and underflow protection.
* Update VottunBridge contract to improve order creation and refund processes. Introduce minimum order amount validation to prevent zero-fee spam, enhance fee management with invocation rewards, and implement single-pass recycling for order and proposal slots. Add new refund functionality and corresponding tests to ensure proper fee handling and order status updates.
* Update feeRecipient and managers initialization in VottunBridge contract to enhance clarity and maintainability. Adjust admin addresses to reflect new configurations while ensuring proper initialization of state variables.
* Remove unrelated files from PR: revert private_settings, public_settings, peers, qubic.cpp, packages.config, gitignore; remove cli.md and tests.md
Made-with: Cursor
* Update guideline for VottunBridge to state change detection
* Update .gitignore to include new files and directories; modify contract definition for VottunBridge state; add contract_vottunbridge to project files.
* Fix XML declaration in test.vcxproj.filters file
* Remove out/ from repo, add to .gitignore
Made-with: Cursor
* Fix reviewer feedback: revert .gitignore to upstream, fix orphaned #endif in contract_def.h
Made-with: Cursor
* Refactor contract_def.h: Remove conditional compilation for PULSE contract definitions
* Fix asset iteration after snapshot loading Rebuilding the index lists changes the order of asset iteration. So rebuilding may lead to misalignment after loading a snapshot. As a solution, the asset index lists are saved in the snapshot and loaded from a file instead of being rebuilt. Rebuilding still happens at the end of the epoch and when the node is started from scratch. * Fix missing return
* Add oracle docs * Improve oracle docs in the code (comments) * Address comments of fnordspace
Collaborator
|
LGTM 👍 |
This file contains hidden or 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
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.
TICK_DURATION_FOR_ALLOCATION_MSandTRANSACTION_SPARSENESS