Skip to content

Conversation

@andrei-marinica
Copy link
Contributor

@andrei-marinica andrei-marinica commented Jan 30, 2026

Pull request overview

This pull request implements a comprehensive refactoring of the digital cash contract, modernizing its architecture and improving the fee management system. The changes introduce a new FungiblePayment type to the framework and completely redesign how deposits and fees are handled in the digital cash contract.

Acknowledgement

Many thanks to @alyn509 for his sizeable contribution to this PR!

Changes:

  • Introduced FungiblePayment<M> type in the framework for handling fungible tokens (tokens with nonce = 0)
  • Fixed a bug in the macro substitution list (Ref/ManagedVecRef have no api generic)
  • Digital cash major refactor:
    • Completely refactored the digital cash contract's fee system from whitelist/blacklist to a flexible base fee configuration with global toggle
    • Replaced time-based expiration (rounds) with timestamp-based expiration (milliseconds)
    • Migrated from ManagedAddress deposit keys to DepositKey (ED25519 public keys) for cryptographic check functionality
    • Renamed endpoints for clarity (e.g., withdrawwithdrawExpired, whitelistFeeTokensetFee)

@github-actions
Copy link

github-actions bot commented Jan 30, 2026

Contract comparison - from d68598c to 42349d9

Path                                                                                             size                  has-allocator                     has-format
fractional-nfts.wasm 8302 false without message
multisig-view.wasm 5590 false None
multisig-full.wasm 15111 false without message
multisig.wasm 13606 false without message
nft-minter.wasm 9726 false without message
ping-pong-egld.wasm 6397 false None
factorial.wasm 579 false None
nft-subscription.wasm 8725 false without message
kitty-auction.wasm 9394 false without message
kitty-genetic-alg.wasm 3494 false without message
kitty-ownership.wasm 12953 false without message
nft-storage-prepay.wasm 2609 false None
crypto-bubbles.wasm 2561 false None
esdt-transfer-with-fee.wasm 7505 false without message
seed-nft-minter.wasm 14189 false without message
adder.wasm 699 false None
bonding-curve-contract.wasm 14016 ➡️ 14011 🟢 (-5) false None
proxy-pause.wasm 4165 false None
empty.wasm 244 false None
crowdfunding.wasm 3574 false None
digital-cash.wasm 9563 ➡️ 9730 🔴 (+167) false None
token-release.wasm 6948 false without message
lottery-esdt.wasm 10585 ➡️ 10580 🟢 (-5) false without message
rewards-distribution.wasm 9449 false without message
check-pause.wasm 1240 false None
order-book-factory.wasm 3401 false None
order-book-pair.wasm 13848 false without message
crypto-zombies.wasm 9276 false without message
set-repeat.wasm 6511 false None
single-value-repeat.wasm 4253 false None
map-repeat.wasm 7363 false without message
queue-repeat.wasm 5536 false None
linked-list-repeat.wasm 6838 false without message
vec-repeat.wasm 4872 false None
str-repeat-mb-builder-cached.wasm 1109 false without message
str-repeat-mb-builder-basic.wasm 757 false None
str-repeat.wasm 2733 false without message
large-storage.wasm 1656 false None
send-tx-repeat.wasm 1292 false None
abi-tester.wasm 8612 ➡️ 8607 🟢 (-5) true without message
abi-tester-ev.wasm 760 false None
exchange-features.wasm 1514 false None
use-module.wasm 32365 ➡️ 32360 🟢 (-5) false without message
use-module-view.wasm 736 false None
panic-message-features.wasm 12838 false with message
panic-message-std.wasm 15886 false with message
big-float-features.wasm 6373 false without message
scenario-tester.wasm 1374 false None
forbidden-opcodes.wasm 842 false None
basic-features.wasm 85420 false without message
basic-features-storage-bytes.wasm 541 false None
payable-features.wasm 6046 false None
std-contract.wasm 3469 true without message
forwarder-queue.wasm 12712 false without message
forwarder-queue-promises.wasm 13336 false without message
forwarder-raw.wasm 13081 false None
forwarder-raw-init-sync-call.wasm 2958 false None
forwarder-raw-init-async-call.wasm 2374 false None
forwarder-legacy.wasm 33267 ➡️ 33262 🟢 (-5) false without message
recursive-caller.wasm 5163 false without message
second-contract.wasm 1158 false None
first-contract.wasm 3450 false None
proxy-test-first.wasm 5711 false without message
transfer-role-features.wasm 8605 false without message
vault.wasm 8857 false None
vault-upgrade.wasm 708 false None
forwarder.wasm 48797 ➡️ 48793 🟢 (-4) false without message
proxy-test-second.wasm 2327 false without message
local-esdt-and-nft.wasm 12259 ➡️ 12254 🟢 (-5) false without message
parent.wasm 1999 false None
child.wasm 3982 false without message
builtin-func-features.wasm 3828 false None
rust-snippets-generator-test.wasm 4708 false None
rust-testing-framework-tester.wasm 8584 false None
multi-contract-features-view.wasm 1113 false None
multi-contract-features.wasm 681 false None
multi-contract-alt-impl.wasm 353 false None
multi-contract-example-feature.wasm 680 false None
alloc-mem-leaking.wasm 23325 false without message
alloc-features.wasm 23168 false without message
alloc-mem-fail.wasm 17720 true without message
erc1155-user-mock.wasm 1229 false None
erc721.wasm 2232 false None
crowdfunding-erc20.wasm 4909 false without message
lottery-erc20.wasm 12886 false without message
erc1155.wasm 11969 false without message
erc1155-marketplace.wasm 10608 ➡️ 10603 🟢 (-5) false without message
erc20.wasm 1887 false None
esdt-system-sc-mock.wasm 4199 false None
formatted-message-features.wasm 3613 false without message
multiversx-price-aggregator-sc.wasm 17901 ➡️ 17896 🟢 (-5) false without message
multiversx-wegld-swap-sc.wasm 4309 ➡️ 4304 🟢 (-5) false None

@andrei-marinica andrei-marinica changed the title Digital cash grand refactor Digital cash grand refactor + FungiblePayment Jan 30, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements a comprehensive refactoring of the digital cash contract, modernizing its architecture and improving the fee management system. The changes introduce a new FungiblePayment type to the framework and completely redesign how deposits and fees are handled in the digital cash contract.

Changes:

  • Introduced FungiblePayment<M> type in the framework for handling fungible tokens (tokens with nonce = 0)
  • Completely refactored the digital cash contract's fee system from whitelist/blacklist to a flexible base fee configuration with global toggle
  • Replaced time-based expiration (rounds) with timestamp-based expiration (milliseconds)
  • Migrated from ManagedAddress deposit keys to DepositKey (ED25519 public keys) for cryptographic check functionality
  • Renamed endpoints for clarity (e.g., withdrawwithdrawExpired, whitelistFeeTokensetFee)

Reviewed changes

Copilot reviewed 36 out of 37 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
framework/derive/src/preprocessing/substitution_list.rs Adds FungiblePayment to managed types list for code generation
framework/base/src/types/managed/wrapped/token/payment.rs Adds fungible_or_panic conversion method and manual TypeAbi impl
framework/base/src/types/managed/wrapped/token/fungible_payment.rs New FungiblePayment type for fungible-only tokens
framework/base/src/types/managed/wrapped/token.rs Exports new FungiblePayment type
framework/base/src/err_msg.rs Renames error message constant for consistency
framework/base/src/contract_base/wrappers/call_value_wrapper.rs Updates to use renamed error constant
contracts/examples/order-book/pair/src/*.rs Renames local FungiblePayment to OrderBookFungiblePayment to avoid conflict
contracts/examples/digital-cash/wasm/src/lib.rs Updates exported endpoint list (11→10 endpoints)
contracts/examples/digital-cash/tests/*.rs Reorders tests alphabetically
contracts/examples/digital-cash/src/storage.rs Completely redesigned storage model with new DepositInfo and fee structures
contracts/examples/digital-cash/src/signature_operations.rs Refactored withdraw/claim/forward logic with improved documentation
contracts/examples/digital-cash/src/pay_fee_and_fund.rs Simplified fee payment logic using new fee system
contracts/examples/digital-cash/src/digital_cash_deposit.rs New module for deposit validation and fee management
contracts/examples/digital-cash/src/digital_cash.rs Updated init and endpoints for new fee system
contracts/examples/digital-cash/src/digital_cash_proxy.rs Updated proxy with comprehensive documentation
contracts/examples/digital-cash/scenarios/*.scen.json Updated all scenarios for new API and EGLD-000000 migration
contracts/examples/digital-cash/README.md Updated documentation with new contract behavior
contracts/examples/digital-cash/Cargo.toml Minor formatting fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@andrei-marinica andrei-marinica marked this pull request as ready for review January 31, 2026 14:00
@andrei-marinica andrei-marinica merged commit dcf00bb into master Jan 31, 2026
23 checks passed
@andrei-marinica andrei-marinica deleted the digital-cash-grand-refactor branch January 31, 2026 18:15
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.

3 participants