Skip to content

Commit

Permalink
feat: added security contract
Browse files Browse the repository at this point in the history
  • Loading branch information
capedcrusader21 committed Sep 16, 2024
1 parent b60a28b commit d368553
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/marketplace/contracts/ExchangeCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {IOrderValidator} from "./interfaces/IOrderValidator.sol";

/// @author The Sandbox
/// @title ExchangeCore Contract
/// @custom:security-contact [email protected]
/// @notice Contains the main functions for the marketplace.
/// @dev This is an abstract contract that requires implementation.
abstract contract ExchangeCore is Initializable, ITransferManager {
Expand Down
1 change: 1 addition & 0 deletions packages/marketplace/contracts/OrderValidator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {Whitelist} from "./Whitelist.sol";

/// @author The Sandbox
/// @title OrderValidator
/// @custom:security-contact [email protected]
/// @notice Contract for order validation. It validates orders and contains a whitelist of tokens.
contract OrderValidator is IOrderValidator, Initializable, EIP712Upgradeable, ERC165Upgradeable, Whitelist {
using SignatureChecker for address;
Expand Down
1 change: 1 addition & 0 deletions packages/marketplace/contracts/RoyaltiesRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {IRoyaltiesProvider, TOTAL_BASIS_POINTS} from "./interfaces/IRoyaltiesPro

/// @author The Sandbox
/// @title RoyaltiesRegistry
/// @custom:security-contact [email protected]
/// @dev Contract managing the registry of royalties.
contract RoyaltiesRegistry is OwnableUpgradeable, IRoyaltiesProvider, ERC165Upgradeable {
using ERC165Checker for address;
Expand Down
1 change: 1 addition & 0 deletions packages/marketplace/contracts/TransferManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {ILandToken} from "@sandbox-smart-contracts/land/contracts/interfaces/ILa

/// @author The Sandbox
/// @title TransferManager
/// @custom:security-contact [email protected]
/// @notice Manages the transfer of assets with support for different fee structures and beneficiaries.
/// @dev This contract can handle various assets like ERC20, ERC721, and ERC1155 tokens.
abstract contract TransferManager is Initializable, ITransferManager {
Expand Down
1 change: 1 addition & 0 deletions packages/marketplace/contracts/Whitelist.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {IWhitelist} from "./interfaces/IWhitelist.sol";

/// @author The Sandbox
/// @title Whitelist contract
/// @custom:security-contact [email protected]
/// @dev A contract to control which tokens are accepted in the marketplace.
contract Whitelist is IWhitelist, Initializable, AccessControlEnumerableUpgradeable {
/// @notice Role for The Sandbox tokens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {LibOrder} from "../libraries/LibOrder.sol";

/// @author The Sandbox
/// @title OrderValidator contract interface
/// @custom:security-contact [email protected]
/// @notice Contains the signature for validate, isPurchaseValid and verifyERC20Whitelist functions
interface IOrderValidator {
/// @notice Verifies order
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ uint256 constant TOTAL_BASIS_POINTS = 10000;

/// @author The Sandbox
/// @title RoyaltiesProvider contract interface
/// @custom:security-contact [email protected]
/// @notice Contains the signature for the getRoyalties function
interface IRoyaltiesProvider {
struct Part {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {LibAsset} from "../libraries/LibAsset.sol";

/// @author The Sandbox
/// @title ITransferManager Interface
/// @custom:security-contact [email protected]
/// @notice Provides an interface for managing transfers of assets between matched orders.
abstract contract ITransferManager {
/// @dev Represents a side (either maker or taker) of a deal.
Expand Down
1 change: 1 addition & 0 deletions packages/marketplace/contracts/interfaces/IWhitelist.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pragma solidity 0.8.23;

/// @author The Sandbox
/// @title Interface for the Whitelist contract
/// @custom:security-contact [email protected]
/// @notice Contains the function signatures for the contract.
interface IWhitelist {
/// @notice Check if a specific role is enabled or disabled.
Expand Down
1 change: 1 addition & 0 deletions packages/marketplace/contracts/libraries/LibAsset.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pragma solidity 0.8.23;

/// @author The Sandbox
/// @title LibAsset: A library for handling different types of Ethereum assets.
/// @custom:security-contact [email protected]
/// @notice This library contains structs, enums, and utility functions for managing and processing Ethereum assets.
library LibAsset {
/// @dev Represents different types of assets on the Ethereum network.
Expand Down
1 change: 1 addition & 0 deletions packages/marketplace/contracts/libraries/LibMath.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pragma solidity 0.8.23;

/// @author The Sandbox
/// @title LibMath: A library for handling specific math operations.
/// @custom:security-contact [email protected]
library LibMath {
uint256 internal constant ACCEPTABLE_RELATIVE_ERROR = 1000;

Expand Down
1 change: 1 addition & 0 deletions packages/marketplace/contracts/libraries/LibOrder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {LibMath} from "./LibMath.sol";

/// @author The Sandbox
/// @title Order Handling Library
/// @custom:security-contact [email protected]
/// @notice Provides tools for constructing, hashing, and validating orders.
library LibOrder {
bytes32 internal constant ORDER_TYPEHASH =
Expand Down

1 comment on commit d368553

@github-actions
Copy link

Choose a reason for hiding this comment

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

Coverage for this commit

98.21%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
packages/marketplace/contracts
   Exchange.sol94.52%93.33%94.44%96%127, 195, 73
   ExchangeCore.sol97.75%93.75%100%100%200, 82
   OrderValidator.sol98.44%96.15%100%100%37
   RoyaltiesRegistry.sol96.32%88.89%100%98.78%195, 217–218, 264, 66
   TransferManager.sol96.04%87.50%100%99.41%164, 226, 248, 334, 394, 431, 582, 587, 598, 620, 94
   Whitelist.sol75.81%60%85.71%82.14%106, 110–111, 124, 127, 143–144, 56, 68, 68–69, 73, 78
packages/marketplace/contracts/interfaces
   IOrderValidator.sol100%100%100%100%
   IRoyaltiesProvider.sol100%100%100%100%
   ITransferManager.sol100%100%100%100%
   IWhitelist.sol100%100%100%100%
packages/marketplace/contracts/libraries
   LibAsset.sol100%100%100%100%
   LibMath.sol100%100%100%100%
   LibOrder.sol100%100%100%100%

Please sign in to comment.