diff --git a/contracts/src/EscrowUniversal.sol b/contracts/src/EscrowUniversal.sol index 9f92e47d..cd0ab2cd 100644 --- a/contracts/src/EscrowUniversal.sol +++ b/contracts/src/EscrowUniversal.sol @@ -10,6 +10,7 @@ pragma solidity 0.8.24; import {IArbitrableV2, IArbitratorV2} from "@kleros/kleros-v2-contracts/arbitration/interfaces/IArbitrableV2.sol"; import "@kleros/kleros-v2-contracts/arbitration/interfaces/IDisputeTemplateRegistry.sol"; import {SafeERC20, IERC20} from "./libraries/SafeERC20.sol"; +import {NATIVE, Status, Party, Transaction, Resolution} from "./interfaces/Types.sol"; import "./interfaces/IEscrow.sol"; /// @title EscrowUniversal for a sale paid in native currency or ERC20 tokens without platform fees. diff --git a/contracts/src/EscrowView.sol b/contracts/src/EscrowView.sol index 54a1ed95..d51ba2a0 100644 --- a/contracts/src/EscrowView.sol +++ b/contracts/src/EscrowView.sol @@ -4,7 +4,8 @@ pragma solidity 0.8.24; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; -import {EscrowUniversal, Transaction, NATIVE, Party, Status, IERC20} from "./EscrowUniversal.sol"; +import {EscrowUniversal} from "./EscrowUniversal.sol"; +import {Transaction, NATIVE, Party, Status, IERC20} from "./interfaces/Types.sol"; /// @title EscrowView /// @notice A view contract for EscrowUniversal to facilitate the display of ruling options. diff --git a/contracts/src/interfaces/IEscrow.sol b/contracts/src/interfaces/IEscrow.sol index 856c1f8a..c738b02f 100644 --- a/contracts/src/interfaces/IEscrow.sol +++ b/contracts/src/interfaces/IEscrow.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.24; -import "./Types.sol"; +import {IERC20, Party, Status, Resolution, Transaction} from "./Types.sol"; interface IEscrow { // ************************************* // @@ -157,6 +157,43 @@ interface IEscrow { /// @return The count of transactions. function getTransactionCount() external view returns (uint256); + /// @dev Getter for transaction details. + /// @param _transactionID The index of the transaction. + /// @return buyer The buyer address. + /// @return seller The seller address. + /// @return amount The escrowed amount. + /// @return settlementBuyer Settlement amount proposed by the buyer. + /// @return settlementSeller Settlement amount proposed by the seller. + /// @return deadline The deadline timestamp. + /// @return disputeID The dispute ID if any. + /// @return buyerFee Total fees paid by the buyer. + /// @return sellerFee Total fees paid by the seller. + /// @return lastFeePaymentTime Timestamp of last fee payment or settlement proposal. + /// @return status Current status. + /// @return token Payment token (zero address for native). + function transactions(uint256 _transactionID) + external + view + returns ( + address payable buyer, + address payable seller, + uint256 amount, + uint256 settlementBuyer, + uint256 settlementSeller, + uint256 deadline, + uint256 disputeID, + uint256 buyerFee, + uint256 sellerFee, + uint256 lastFeePaymentTime, + Status status, + IERC20 token + ); + + /// @dev Getter to map a dispute ID to its transaction ID. + /// @param _disputeID The dispute identifier from the arbitrator. + /// @return The corresponding transaction ID. + function disputeIDtoTransactionID(uint256 _disputeID) external view returns (uint256); + // ************************************* // // * Errors * // // ************************************* //