Skip to content

Smart Contract Interactions ​

Interaction between Treasury Service and TradeToken/Collateral Vault ​

The Treasury Service acts as a critical intermediary, facilitating the movement of tokens between the public EVM network and the private EVM network.

  • When a buyer wants to acquire TRADE-P tokens (the private chain collateral asset), they first deposit TRADE-S tokens into their individual Collateral Vault on the public EVM network.
  • The Collateral Vault contract notifies the Treasury Service about this deposit.
  • The Treasury Service then locks the deposited TRADE-S tokens within the buyer's Collateral Vault.
  • Subsequently, the Treasury Service interacts with the TradeToken smart contract on the private EVM network to mint an equal amount of TRADE-P tokens (1:1 ratio) and transfers them to the buyer's Pledge Credit balance.
  • In scenarios requiring the conversion of TRADE-P tokens back to their underlying TRADE-S collateral (like after PayPledge settlement), the Treasury Service facilitates the reverse bridging. This process involves the Treasury Service interacting with the TradeToken to burn TRADE-P tokens and with the Collateral Vault to release the corresponding TRADE-S tokens to the seller's Clearing Account.
  • The TradeToken contract itself is designed to specifically manage the minting and burning of TRADE-P tokens and has controlled interactions with the Treasury Service and the Collateral Vault (via the Treasury Service).

Interaction between CollateralManager and PayPledge/TRADE-P Token ​

The CollateralManager smart contract plays a central role in the underwriting process, managing the offers and the collateral.

  • Underwriters interact directly with the CollateralManager Contract. When preparing to offer collateral for a PayPledge, an underwriter formulates a Credit Underwriting Offer (CUOf).
  • Submitting a CUOf involves the underwriter first approving the CollateralManager contract to transfer a specific amount of their TRADE-P tokens. The underwriter then calls the submitCUOf function on the CollateralManager.
  • After the Platform Admin selects the best CUOf, the CollateralManager is responsible for securing the underwriter's offered TRADE-P tokens. It then transfers these TRADE-P tokens to the relevant PayPledge contract that requires collateralization.
  • This process highlights how the CollateralManager connects the underwriter's TRADE-P tokens to the specific trade transaction represented by the PayPledge contract.

Interactions between Paypledge and Buyers/Sellers/Payment Processors/Underwriters ​

The PayPledge smart contract is the core digital agreement that governs the trade transaction, interacting directly with the key parties involved.

  • Buyer Interactions:
    • The Buyer initiates the transaction by deploying and initializing the PayPledge contract.
    • When the Buyer fulfills their payment obligation (either directly to the Seller in fiat or to a Payment Processor after early financing), the Buyer initiates the contract discharge by calling the initiateDischarge function on the PayPledge contract.
    • Buyers can also refute condition fulfillment initiated by the Seller if they believe the conditions haven't been met, utilizing the contract's refutation mechanism.
  • Seller Interactions:
    • The Seller accepts the commitment by calling the accept() function on the PayPledge contract once the collateral is secured.
    • After delivering goods or services, the Seller calls the fulfillCondition function on the PayPledge contract.
    • The Seller can request early financing by calling the createTokenExchange function on the PayPledge contract.
    • Sellers can also refute the discharge process if they have not received payment.
    • The PayPledge contract provides the Seller with crucial payment assurance due to the collateral it manages.
    • Sellers can also request changes to the collateral value or due date via the contract.
  • Payment Processor Interactions:
    • In early financing scenarios, the Payment Processor receives ERC-1155 tokens (representing collateral) from the Seller in exchange for advancing fiat.
    • In case of a Buyer default, the Payment Processor initiates a default discharge on the PayPledge contract to claim the collateral by calling initiateDefaultDischarge.
    • The Payment Processor can also refute the discharge initiated by the Buyer if payment hasn't been received.
  • Underwriter Interactions:
    • The Underwriter provides collateral (TRADE-P tokens) which are transferred to the PayPledge contract by the CollateralManager.
    • The PayPledge contract holds and manages this collateral.
    • Upon successful discharge, the collateral is released from the PayPledge contract and returned to the Underwriter (via the CollateralManager).
    • In case of default, the Payment Processor claims the collateral from the PayPledge contract.
  • Dispute Resolver Interactions:
    • When a dispute arises (e.g., refuted condition fulfillment or discharge), the Dispute Resolver can interact with the PayPledge contract.
    • The Dispute Resolver has the ability to override refutations and make a final decision to finalize or cancel actions like condition fulfillment or discharge.

Interaction between TRADE-S Token and Platform Components ​

The TRADE-S token serves as the foundational collateral asset on the public EVM network, enabling the entire SecureTrade platform ecosystem.

  • Platform Admin Interactions:
    • The Platform Admin mints TRADE-S tokens to users' Clearing Accounts as needed for collateral backing.
    • The Platform Admin has full administrative control over token minting, pausing, and role management.
  • Buyer Interactions:
    • Buyers receive TRADE-S tokens in their Clearing Account from the Platform Admin.
    • Buyers deposit TRADE-S tokens from their Clearing Account into their individual Collateral Vault.
    • This deposit triggers the Treasury Service to mint corresponding TRADE-P tokens on the private network.
  • Collateral Vault Interactions:
    • The Collateral Vault contract securely holds TRADE-S tokens in individual user-specific vaults.
    • Vault balances are tracked separately for each user, ensuring isolation and security.
    • The Treasury Service can withdraw TRADE-S tokens from vaults when PayPledges settle, transferring them to sellers' Clearing Accounts.
  • Treasury Service Interactions:
    • The Treasury Service monitors Collateral Vault deposits and triggers TRADE-P minting on the private network.
    • The Treasury Service manages withdrawals from Collateral Vaults when PayPledges are settled.
    • This creates a 1:1 peg between TRADE-S tokens (public) and TRADE-P tokens (private).

These interactions, governed by the logic encoded in the smart contracts, automate and secure the core trade finance process on the platform.