diff --git a/contracts/invoice-escrow/src/events.rs b/contracts/invoice-escrow/src/events.rs index 8d57a18..53bd575 100644 --- a/contracts/invoice-escrow/src/events.rs +++ b/contracts/invoice-escrow/src/events.rs @@ -47,3 +47,11 @@ pub fn escrow_refunded(env: &Env, inv_id: Symbol, funder: &Address, amount: i128 (inv_id, funder, amount), ); } + +/// Publish platform fee update event with old and new basis points. +pub fn platform_fee_updated(env: &Env, old_fee_bps: u32, new_fee_bps: u32) { + env.events().publish( + (Symbol::new(env, "platform_fee_updated"),), + (old_fee_bps, new_fee_bps), + ); +} diff --git a/contracts/invoice-escrow/src/integration_test.rs b/contracts/invoice-escrow/src/integration_test.rs index 0a0fbc8..af87de5 100644 --- a/contracts/invoice-escrow/src/integration_test.rs +++ b/contracts/invoice-escrow/src/integration_test.rs @@ -1,5 +1,3 @@ -#![cfg(test)] - use super::*; use invoice_token::{InvoiceToken, InvoiceTokenClient}; use soroban_sdk::token::{Client as TokenClient, StellarAssetClient as AssetClient}; @@ -20,11 +18,11 @@ fn test_integration_escrow_lifecycle_happy_path() { let payer = Address::generate(&env); // 2. Register Escrow Contract - let escrow_id = env.register_contract(None, InvoiceEscrow); + let escrow_id = env.register(InvoiceEscrow, ()); let escrow_client = InvoiceEscrowClient::new(&env, &escrow_id); // 3. Register Token Contract - let inv_token_id = env.register_contract(None, InvoiceToken); + let inv_token_id = env.register(InvoiceToken, ()); let inv_token_client = InvoiceTokenClient::new(&env, &inv_token_id); // 4. Register Payment Token (Stellar Asset) @@ -111,10 +109,10 @@ fn test_integration_refund_lifecycle() { let seller = Address::generate(&env); let buyer = Address::generate(&env); - let escrow_id = env.register_contract(None, InvoiceEscrow); + let escrow_id = env.register(InvoiceEscrow, ()); let escrow_client = InvoiceEscrowClient::new(&env, &escrow_id); - let inv_token_id = env.register_contract(None, InvoiceToken); + let inv_token_id = env.register(InvoiceToken, ()); let inv_token_client = InvoiceTokenClient::new(&env, &inv_token_id); let payment_token_admin = Address::generate(&env); @@ -181,10 +179,10 @@ fn test_integration_token_locked_during_active_escrow() { let seller = Address::generate(&env); let buyer = Address::generate(&env); - let escrow_id = env.register_contract(None, InvoiceEscrow); + let escrow_id = env.register(InvoiceEscrow, ()); let escrow_client = InvoiceEscrowClient::new(&env, &escrow_id); - let inv_token_id = env.register_contract(None, InvoiceToken); + let inv_token_id = env.register(InvoiceToken, ()); let inv_token_client = InvoiceTokenClient::new(&env, &inv_token_id); let payment_token_admin = Address::generate(&env); diff --git a/contracts/invoice-escrow/src/lib.rs b/contracts/invoice-escrow/src/lib.rs index 3eae3e0..8269046 100644 --- a/contracts/invoice-escrow/src/lib.rs +++ b/contracts/invoice-escrow/src/lib.rs @@ -224,8 +224,10 @@ impl InvoiceEscrow { if new_fee_bps > MAX_BPS { return Err(Error::InvalidFeeBps); } + let old_fee_bps = config.fee_bps; config.fee_bps = new_fee_bps; storage::set_config(&env, &config); + events::platform_fee_updated(&env, old_fee_bps, new_fee_bps); Ok(()) } diff --git a/contracts/invoice-escrow/src/test.rs b/contracts/invoice-escrow/src/test.rs index bca9a55..f21424a 100644 --- a/contracts/invoice-escrow/src/test.rs +++ b/contracts/invoice-escrow/src/test.rs @@ -1,4 +1,3 @@ -#![cfg(test)] #![allow(deprecated)] use super::*; @@ -397,7 +396,7 @@ fn test_no_settlement_event_on_invalid_state() { let (_addr, topics, _data) = event; // Check if this is a payment_settled event let topic_vec: soroban_sdk::Vec = topics.clone(); - if topic_vec.len() > 0 { + if !topic_vec.is_empty() { if let Ok(symbol) = topic_vec.get(0).unwrap().try_into_val(&env) { let sym: Symbol = symbol; // Assert that no payment_settled event exists @@ -451,7 +450,7 @@ fn test_no_refund_event_on_invalid_state() { let (_addr, topics, _data) = event; // Check if this is an escrow_refunded event let topic_vec: soroban_sdk::Vec = topics.clone(); - if topic_vec.len() > 0 { + if !topic_vec.is_empty() { if let Ok(symbol) = topic_vec.get(0).unwrap().try_into_val(&env) { let sym: Symbol = symbol; // Assert that no escrow_refunded event exists @@ -1166,9 +1165,16 @@ fn test_update_platform_fee() { // Update fee escrow_client.update_platform_fee_bps(&500); - // Verify updated fee - let config = escrow_client.get_config(); - assert_eq!(config.fee_bps, 500); + // The update should emit a platform_fee_updated event with old/new values. + let events = env.events().all(); + let event = events.last().unwrap(); + let (_contract_addr, topics, data) = event; + assert_eq!( + topics, + (Symbol::new(&env, "platform_fee_updated"),).into_val(&env) + ); + let event_data: (u32, u32) = data.try_into_val(&env).unwrap(); + assert_eq!(event_data, (300, 500)); } // ========== View Function Tests ========== diff --git a/contracts/invoice-escrow/test_snapshots/test/test_update_platform_fee.1.json b/contracts/invoice-escrow/test_snapshots/test/test_update_platform_fee.1.json index 3fe5dfb..ef223c8 100644 --- a/contracts/invoice-escrow/test_snapshots/test/test_update_platform_fee.1.json +++ b/contracts/invoice-escrow/test_snapshots/test/test_update_platform_fee.1.json @@ -25,8 +25,7 @@ "sub_invocations": [] } ] - ], - [] + ] ], "ledger": { "protocol_version": 22, @@ -156,5 +155,33 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "contract", + "body": { + "v0": { + "topics": [ + { + "symbol": "platform_fee_updated" + } + ], + "data": { + "vec": [ + { + "u32": 300 + }, + { + "u32": 500 + } + ] + } + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/contracts/invoice-token/src/events.rs b/contracts/invoice-token/src/events.rs index 7d09e52..22434ac 100644 --- a/contracts/invoice-token/src/events.rs +++ b/contracts/invoice-token/src/events.rs @@ -32,3 +32,19 @@ pub fn burn_event(env: &Env, from: &Address, amount: i128) { env.events() .publish((Symbol::new(env, "burn"), from), amount); } + +/// Emit transfer_locked update event with previous and new values. +pub fn transfer_locked_updated_event(env: &Env, old_value: bool, new_value: bool) { + env.events().publish( + (Symbol::new(env, "transfer_locked_updated"),), + (old_value, new_value), + ); +} + +/// Emit minter update event with previous and new minter addresses. +pub fn minter_updated_event(env: &Env, old_minter: &Address, new_minter: &Address) { + env.events().publish( + (Symbol::new(env, "minter_updated"),), + (old_minter, new_minter), + ); +} diff --git a/contracts/invoice-token/src/lib.rs b/contracts/invoice-token/src/lib.rs index 07dda84..d60e300 100644 --- a/contracts/invoice-token/src/lib.rs +++ b/contracts/invoice-token/src/lib.rs @@ -251,17 +251,21 @@ impl InvoiceToken { if caller != meta.admin && caller != meta.minter { return Err(Error::Unauthorized); } + let old_locked = meta.transfer_locked; meta.transfer_locked = locked; storage::set_metadata(&env, &meta); + events::transfer_locked_updated_event(&env, old_locked, locked); Ok(()) } /// Set minter address (admin only). pub fn set_minter(env: Env, new_minter: Address) -> Result<(), Error> { let mut meta = storage::get_metadata(&env).ok_or(Error::NotInit)?; + let old_minter = meta.minter.clone(); meta.admin.require_auth(); meta.minter = new_minter; storage::set_metadata(&env, &meta); + events::minter_updated_event(&env, &old_minter, &meta.minter); Ok(()) } diff --git a/contracts/invoice-token/src/test.rs b/contracts/invoice-token/src/test.rs index b880734..dd03d58 100644 --- a/contracts/invoice-token/src/test.rs +++ b/contracts/invoice-token/src/test.rs @@ -6,7 +6,7 @@ use soroban_sdk::{Address, Env, IntoVal, String as SorobanString, Symbol, TryInt fn setup_token(env: &Env) -> (InvoiceTokenClient<'_>, Address, Address) { let contract_id = env.register(InvoiceToken, ()); - let client = InvoiceTokenClient::new(&env, &contract_id); + let client = InvoiceTokenClient::new(env, &contract_id); let admin = Address::generate(env); let minter = Address::generate(env); let name = SorobanString::from_str(env, "Invoice INV-001"); @@ -190,6 +190,27 @@ fn test_set_transfer_locked_toggle() { assert_eq!(result, Err(Ok(crate::errors::Error::TransferLocked))); } +#[test] +fn test_set_transfer_locked_event_emission() { + let env = Env::default(); + env.mock_all_auths(); + let (client, admin, minter) = setup_token(&env); + + // Admin unlocks transfers and emits the old/new lock state. + client.mint(&admin, &1000, &minter); + client.set_transfer_locked(&admin, &false); + + let events = env.events().all(); + let event = events.last().unwrap(); + let (_contract_addr, topics, data) = event; + assert_eq!( + topics, + (Symbol::new(&env, "transfer_locked_updated"),).into_val(&env) + ); + let event_data: (bool, bool) = data.try_into_val(&env).unwrap(); + assert_eq!(event_data, (true, false)); +} + #[test] fn test_set_transfer_locked_by_minter() { let env = Env::default(); @@ -209,6 +230,27 @@ fn test_set_transfer_locked_by_minter() { assert!(client.transfer_locked()); } +#[test] +fn test_set_minter_event_emission() { + let env = Env::default(); + env.mock_all_auths(); + let (client, _admin, old_minter) = setup_token(&env); + + let new_minter = Address::generate(&env); + client.set_minter(&new_minter); + + let events = env.events().all(); + let event = events.last().unwrap(); + let (_contract_addr, topics, data) = event; + assert_eq!( + topics, + (Symbol::new(&env, "minter_updated"),).into_val(&env) + ); + let event_data: (Address, Address) = data.try_into_val(&env).unwrap(); + assert_eq!(event_data.0, old_minter); + assert_eq!(event_data.1, new_minter); +} + #[test] fn test_set_transfer_locked_unauthorized_fails() { let env = Env::default(); diff --git a/contracts/invoice-token/test_snapshots/test/test_set_minter_event_emission.1.json b/contracts/invoice-token/test_snapshots/test/test_set_minter_event_emission.1.json new file mode 100644 index 0000000..03efef7 --- /dev/null +++ b/contracts/invoice-token/test_snapshots/test/test_set_minter_event_emission.1.json @@ -0,0 +1,241 @@ +{ + "generators": { + "address": 4, + "nonce": 0 + }, + "auth": [ + [], + [], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "function_name": "set_minter", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAITA4" + } + ] + } + }, + "sub_invocations": [] + } + ] + ] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": [ + { + "key": { + "vec": [ + { + "symbol": "Metadata" + } + ] + }, + "val": { + "map": [ + { + "key": { + "symbol": "admin" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + }, + { + "key": { + "symbol": "decimals" + }, + "val": { + "u32": 7 + } + }, + { + "key": { + "symbol": "invoice_id" + }, + "val": { + "symbol": "inv_001" + } + }, + { + "key": { + "symbol": "minter" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAITA4" + } + }, + { + "key": { + "symbol": "name" + }, + "val": { + "string": "Invoice INV-001" + } + }, + { + "key": { + "symbol": "symbol" + }, + "val": { + "string": "INV001" + } + }, + { + "key": { + "symbol": "transfer_locked" + }, + "val": { + "bool": true + } + } + ] + } + }, + { + "key": { + "vec": [ + { + "symbol": "TotalSupply" + } + ] + }, + "val": { + "i128": { + "hi": 0, + "lo": 0 + } + } + } + ] + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [ + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "contract", + "body": { + "v0": { + "topics": [ + { + "symbol": "minter_updated" + } + ], + "data": { + "vec": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAITA4" + } + ] + } + } + } + }, + "failed_call": false + } + ] +} \ No newline at end of file diff --git a/contracts/invoice-token/test_snapshots/test/test_set_transfer_locked_event_emission.1.json b/contracts/invoice-token/test_snapshots/test/test_set_transfer_locked_event_emission.1.json new file mode 100644 index 0000000..6ae6b81 --- /dev/null +++ b/contracts/invoice-token/test_snapshots/test/test_set_transfer_locked_event_emission.1.json @@ -0,0 +1,353 @@ +{ + "generators": { + "address": 3, + "nonce": 0 + }, + "auth": [ + [], + [], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "function_name": "mint", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + }, + { + "i128": { + "hi": 0, + "lo": 1000 + } + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + } + ] + } + }, + "sub_invocations": [] + } + ] + ], + [ + [ + "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + { + "function": { + "contract_fn": { + "contract_address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "function_name": "set_transfer_locked", + "args": [ + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + }, + { + "bool": false + } + ] + } + }, + "sub_invocations": [] + } + ] + ] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Balance" + }, + { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + ] + }, + "durability": "persistent", + "val": { + "i128": { + "hi": 0, + "lo": 1000 + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": [ + { + "key": { + "vec": [ + { + "symbol": "Metadata" + } + ] + }, + "val": { + "map": [ + { + "key": { + "symbol": "admin" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4" + } + }, + { + "key": { + "symbol": "decimals" + }, + "val": { + "u32": 7 + } + }, + { + "key": { + "symbol": "invoice_id" + }, + "val": { + "symbol": "inv_001" + } + }, + { + "key": { + "symbol": "minter" + }, + "val": { + "address": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" + } + }, + { + "key": { + "symbol": "name" + }, + "val": { + "string": "Invoice INV-001" + } + }, + { + "key": { + "symbol": "symbol" + }, + "val": { + "string": "INV001" + } + }, + { + "key": { + "symbol": "transfer_locked" + }, + "val": { + "bool": false + } + } + ] + } + }, + { + "key": { + "vec": [ + { + "symbol": "TotalSupply" + } + ] + }, + "val": { + "i128": { + "hi": 0, + "lo": 1000 + } + } + } + ] + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "ledger_key_nonce": { + "nonce": 5541220902715666415 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", + "key": { + "ledger_key_nonce": { + "nonce": 5541220902715666415 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", + "key": { + "ledger_key_nonce": { + "nonce": 801925984706572462 + } + }, + "durability": "temporary", + "val": "void" + } + }, + "ext": "v0" + }, + 6311999 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [ + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "contract", + "body": { + "v0": { + "topics": [ + { + "symbol": "transfer_locked_updated" + } + ], + "data": { + "vec": [ + { + "bool": true + }, + { + "bool": false + } + ] + } + } + } + }, + "failed_call": false + } + ] +} \ No newline at end of file diff --git a/contracts/payment-distributor/src/test.rs b/contracts/payment-distributor/src/test.rs index 47068d4..dae733d 100644 --- a/contracts/payment-distributor/src/test.rs +++ b/contracts/payment-distributor/src/test.rs @@ -1,4 +1,3 @@ -#![cfg(test)] #![allow(deprecated)] use super::*; diff --git a/docs/API.md b/docs/API.md index ab83ab8..33f39c0 100644 --- a/docs/API.md +++ b/docs/API.md @@ -19,6 +19,12 @@ Distributes a specified amount of a token to a recipient address. This function ### `get_admin() -> Address` Returns the current administrative address of the contract. +## Invoice Token Contract + +### Events +- `transfer_locked_updated(old_locked: bool, new_locked: bool)` +- `minter_updated(old_minter: Address, new_minter: Address)` + ## Invoice Escrow Contract (Legacy documentation for reference) @@ -34,3 +40,6 @@ Records a full or partial payment for a funded invoice. ### `refund(invoice_id: Symbol)` Returns the remaining (un-released) investor funding if the invoice is not paid by its due date. + +### Events +- `platform_fee_updated(old_fee_bps: u32, new_fee_bps: u32)`