Skip to content

Commit c382dc8

Browse files
authored
Merge pull request #128 from 0xshitake/feat/add-getters-to-interface
feat: add getters to interface
2 parents 7dd88a4 + f8354ba commit c382dc8

File tree

3 files changed

+41
-2
lines changed

3 files changed

+41
-2
lines changed

contracts/src/EscrowUniversal.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pragma solidity 0.8.24;
1010
import {IArbitrableV2, IArbitratorV2} from "@kleros/kleros-v2-contracts/arbitration/interfaces/IArbitrableV2.sol";
1111
import "@kleros/kleros-v2-contracts/arbitration/interfaces/IDisputeTemplateRegistry.sol";
1212
import {SafeERC20, IERC20} from "./libraries/SafeERC20.sol";
13+
import {NATIVE, Status, Party, Transaction, Resolution} from "./interfaces/Types.sol";
1314
import "./interfaces/IEscrow.sol";
1415

1516
/// @title EscrowUniversal for a sale paid in native currency or ERC20 tokens without platform fees.

contracts/src/EscrowView.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ pragma solidity 0.8.24;
44

55
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
66
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
7-
import {EscrowUniversal, Transaction, NATIVE, Party, Status, IERC20} from "./EscrowUniversal.sol";
7+
import {EscrowUniversal} from "./EscrowUniversal.sol";
8+
import {Transaction, NATIVE, Party, Status, IERC20} from "./interfaces/Types.sol";
89

910
/// @title EscrowView
1011
/// @notice A view contract for EscrowUniversal to facilitate the display of ruling options.

contracts/src/interfaces/IEscrow.sol

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
pragma solidity 0.8.24;
44

5-
import "./Types.sol";
5+
import {IERC20, Party, Status, Resolution, Transaction} from "./Types.sol";
66

77
interface IEscrow {
88
// ************************************* //
@@ -157,6 +157,43 @@ interface IEscrow {
157157
/// @return The count of transactions.
158158
function getTransactionCount() external view returns (uint256);
159159

160+
/// @dev Getter for transaction details.
161+
/// @param _transactionID The index of the transaction.
162+
/// @return buyer The buyer address.
163+
/// @return seller The seller address.
164+
/// @return amount The escrowed amount.
165+
/// @return settlementBuyer Settlement amount proposed by the buyer.
166+
/// @return settlementSeller Settlement amount proposed by the seller.
167+
/// @return deadline The deadline timestamp.
168+
/// @return disputeID The dispute ID if any.
169+
/// @return buyerFee Total fees paid by the buyer.
170+
/// @return sellerFee Total fees paid by the seller.
171+
/// @return lastFeePaymentTime Timestamp of last fee payment or settlement proposal.
172+
/// @return status Current status.
173+
/// @return token Payment token (zero address for native).
174+
function transactions(uint256 _transactionID)
175+
external
176+
view
177+
returns (
178+
address payable buyer,
179+
address payable seller,
180+
uint256 amount,
181+
uint256 settlementBuyer,
182+
uint256 settlementSeller,
183+
uint256 deadline,
184+
uint256 disputeID,
185+
uint256 buyerFee,
186+
uint256 sellerFee,
187+
uint256 lastFeePaymentTime,
188+
Status status,
189+
IERC20 token
190+
);
191+
192+
/// @dev Getter to map a dispute ID to its transaction ID.
193+
/// @param _disputeID The dispute identifier from the arbitrator.
194+
/// @return The corresponding transaction ID.
195+
function disputeIDtoTransactionID(uint256 _disputeID) external view returns (uint256);
196+
160197
// ************************************* //
161198
// * Errors * //
162199
// ************************************* //

0 commit comments

Comments
 (0)