Skip to content

Conversation

@alyn509
Copy link
Contributor

@alyn509 alyn509 commented Dec 15, 2025

No description provided.

Base automatically changed from feat/new-payment-obj to rc/v0.64 December 16, 2025 14:31
Base automatically changed from rc/v0.64 to master December 18, 2025 13:39
@alyn509 alyn509 marked this pull request as ready for review December 29, 2025 15:00
@github-actions
Copy link

github-actions bot commented Dec 29, 2025

Contract comparison - from 5fb0bf2 to ab534f4

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 14011 false None
proxy-pause.wasm 4165 false None
empty.wasm 244 false None
crowdfunding.wasm 3574 false None
digital-cash.wasm 9454 false None
token-release.wasm 6948 false without message
lottery-esdt.wasm 10580 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 8607 true without message
abi-tester-ev.wasm 760 false None
exchange-features.wasm 1514 false None
use-module.wasm 32360 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 33262 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 48793 false without message
proxy-test-second.wasm 2327 false without message
local-esdt-and-nft.wasm 12254 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 10603 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 17896 false without message
multiversx-wegld-swap-sc.wasm 4304 false None

⚠️ Could not download the report for the base branch. Displaying only the report for the current branch. ⚠️

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 PR migrates the digital-cash smart contract to use the new MultiversX payment APIs and transitions from block round-based to timestamp-based expiration tracking.

Changes:

  • Migrated from EgldOrEsdtTokenIdentifier/EgldOrEsdtTokenPayment types to TokenId/Payment types throughout the codebase
  • Changed expiration tracking from block rounds (valability/expiration_round) to timestamps (expiration in milliseconds)
  • Renamed blacklistFeeToken endpoint to removeFeeToken for better clarity
  • Reorganized error message constants into a dedicated digital_cash_err_msg.rs module
  • Updated all test scenarios to reflect the new timestamp-based expiration model

Reviewed changes

Copilot reviewed 27 out of 28 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
wasm/src/lib.rs Updated endpoint mapping from blacklistFeeToken to removeFeeToken
tests/digital_cash_scenario_rs_test.rs Reordered test functions alphabetically
tests/digital_cash_scenario_go_test.rs Reordered test functions alphabetically
src/storage.rs Migrated storage mappers to use TokenId instead of EgldOrEsdtTokenIdentifier
src/signature_operations.rs Updated to use Payment type and timestamp-based expiration checks
src/pay_fee_and_fund.rs Migrated payment handling to new API and timestamp-based expiration
src/helpers.rs Added helper functions for fee calculation and migrated to new payment types
src/digital_cash_proxy.rs Updated proxy signatures to use TokenId and TimestampMillis types
src/digital_cash_err_msg.rs New file containing error message constants
src/digital_cash.rs Updated init and endpoint signatures, migrated fee collection logic
src/deposit_info.rs Updated structs to use Payment and TimestampMillis
src/constants.rs Deleted file, constants moved to digital_cash_err_msg.rs
scenarios/*.scen.json Updated all scenario files with timestamp-based expiration and new token identifiers
README.md Partially updated documentation (incomplete migration noted in comments)
Cargo.toml Minor formatting fix for authors field

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

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

Copilot reviewed 27 out of 28 changed files in this pull request and generated 10 comments.


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

) {
let paid_fee = self.call_value().egld_or_single_esdt();
let additional_fee_payment = self.call_value().single_optional();
let caller_address = self.blockchain().get_caller();
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

The variable name caller_address is misleading in this context. The variable is only used to pass to update_fees but is actually cloned from self.blockchain().get_caller() before the closure. Inside the closure (lines 104-127), the variable is captured by value and used in line 107, but it represents the caller at the time of the forward call, not necessarily related to the deposit being updated. Consider renaming it to forward_caller or original_caller for clarity.

Copilot uses AI. Check for mistakes.
Comment on lines 59 to 60
require!(
self.blockchain().get_caller() == depositor,
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

The error message "invalid depositor" should be updated to "invalid depositor address" or more descriptively "only the original depositor can add funds to this deposit" to be more clear and helpful to users.

Copilot uses AI. Check for mistakes.
Comment on lines +57 to +58
fn whitelist_blacklist_fee_tokens_go() {
world().run("scenarios/whitelist-blacklist-fee-tokens.scen.json");
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

Test function renamed from whitelist_blacklist_fee_token_go to whitelist_blacklist_fee_tokens_go. Note that the function name contains "blacklist" but the actual endpoint has been renamed to removeFeeToken. Consider renaming to whitelist_remove_fee_tokens_go for consistency with the new endpoint naming.

Suggested change
fn whitelist_blacklist_fee_tokens_go() {
world().run("scenarios/whitelist-blacklist-fee-tokens.scen.json");
fn whitelist_remove_fee_tokens_go() {
world().run("scenarios/whitelist-remove-fee-tokens.scen.json");

Copilot uses AI. Check for mistakes.
Comment on lines 7 to 10
Each deposit is stored at a specific address (the check address). To claim funds:
1. The recipient must provide a valid ED25519 signature proving they control the check address's private key
2. The deposit must not have expired
3. Fees must have been paid upfront by the depositor
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

The documentation states that deposits are stored at "a specific address (the check address)" and that recipients need to "prove ownership of the check address's private key". However, the actual implementation uses a DepositKey which is a 32-byte array (ManagedByteArray<M, 32>), not necessarily an address. The documentation should clarify that the deposit key is a 32-byte value used for ED25519 signature verification, which may or may not correspond to a blockchain address.

Copilot uses AI. Check for mistakes.
Comment on lines 39 to 40
- `address`: The check address containing the deposit
- `signature`: ED25519 signature proving ownership of the check's private key
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

The documentation states the parameter is named address, but the actual parameter name in the code is deposit_key. The documentation should be updated to use deposit_key to match the actual API.

Copilot uses AI. Check for mistakes.
## Withdrawing Funds

If a deposit has expired and hasn't been claimed, the original depositor can reclaim everything by calling `withdraw`:
- `address`: The check address containing the expired deposit
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

The documentation states the parameter is named address, but the actual parameter name in the code is deposit_key. The documentation should be updated to use deposit_key to match the actual API.

Copilot uses AI. Check for mistakes.
Comment on lines 59 to 61
- `address`: The current check address (source)
- `forward_address`: The new check address (destination)
- `signature`: ED25519 signature proving ownership of the source check
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

The documentation states the parameters are named address and forward_address, but the actual parameter names in the code are deposit_key and forward_deposit_key. The documentation should be updated to match the actual API.

Copilot uses AI. Check for mistakes.
Comment on lines +65 to +66
fn whitelist_blacklist_fee_tokens_rs() {
world().run("scenarios/whitelist-blacklist-fee-tokens.scen.json");
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

Test function renamed from whitelist_blacklist_fee_token_rs to whitelist_blacklist_fee_tokens_rs. Note that the function name contains "blacklist" but the actual endpoint has been renamed to removeFeeToken. Consider renaming to whitelist_remove_fee_tokens_rs for consistency with the new endpoint naming.

Suggested change
fn whitelist_blacklist_fee_tokens_rs() {
world().run("scenarios/whitelist-blacklist-fee-tokens.scen.json");
fn whitelist_remove_fee_tokens_rs() {
world().run("scenarios/whitelist-remove-fee-tokens.scen.json");

Copilot uses AI. Check for mistakes.
Comment on lines 26 to 27
- `address`: The check address where funds will be stored
- `expiration`: Timestamp in milliseconds when the deposit expires
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

The documentation states the parameter is named address, but the actual parameter name in the code is deposit_key. The documentation should be updated to use deposit_key to match the actual API.

Copilot uses AI. Check for mistakes.
}

#[endpoint(depositFees)]
#[payable("EGLD")]
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

The #[payable("EGLD")] annotation restricts this endpoint to only accept EGLD payments. However, the contract supports multiple whitelisted fee tokens. This annotation should be removed or changed to #[payable] to allow any whitelisted token to be used for fee deposits, as the get_fee_for_token validation will ensure only whitelisted tokens are accepted.

Suggested change
#[payable("EGLD")]
#[payable]

Copilot uses AI. Check for mistakes.
@andrei-marinica andrei-marinica merged commit 094b4ba into master Jan 31, 2026
42 of 45 checks passed
@andrei-marinica andrei-marinica deleted the digital-cash-payments-migration 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