Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/snapshots/BoundlessMarketBasicTest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ERC20 approve: required for depositCollateral": "45966",
"bytecode size implementation": "24236",
"bytecode size implementation": "24312",
"bytecode size proxy": "89",
"deposit: first ever deposit": "50942",
"deposit: second deposit": "33842",
Expand Down
9 changes: 9 additions & 0 deletions contracts/src/BoundlessMarket.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ contract BoundlessMarket is
uint32 deprecatedAssessorDuration,
address collateralTokenContract
) {
// Validate non-zero critical params
require(address(verifier) != address(0), "Invalid verifier");
require(assessorId != bytes32(0), "Invalid assessor image");
require(collateralTokenContract != address(0), "Invalid collateral token");
if (deprecatedAssessorDuration > 0) {
require(deprecatedAssessorId != bytes32(0), "Invalid deprecated assessor image");
}

VERIFIER = verifier;
ASSESSOR_ID = assessorId;
COLLATERAL_TOKEN_CONTRACT = collateralTokenContract;
Expand All @@ -129,6 +137,7 @@ contract BoundlessMarket is
}

function initialize(address initialOwner, string calldata _imageUrl) external initializer {
require(initialOwner != address(0), "Invalid initial owner");
__AccessControl_init();
__UUPSUpgradeable_init();
__EIP712_init(BoundlessMarketLib.EIP712_DOMAIN, BoundlessMarketLib.EIP712_DOMAIN_VERSION);
Expand Down
4 changes: 2 additions & 2 deletions contracts/test/BoundlessMarket.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4239,7 +4239,7 @@ contract BoundlessMarketUpgradeTest is BoundlessMarketTest {
ASSESSOR_IMAGE_ID,
DEPRECATED_ASSESSOR_IMAGE_ID,
DEPRECATED_ASSESSOR_DURATION,
address(0)
address(0x01)
)
),
abi.encodeCall(BoundlessMarket.initialize, (ownerWallet.addr, "https://assessor.dev.null"))
Expand All @@ -4258,7 +4258,7 @@ contract BoundlessMarketUpgradeTest is BoundlessMarketTest {
ASSESSOR_IMAGE_ID,
DEPRECATED_ASSESSOR_IMAGE_ID,
DEPRECATED_ASSESSOR_DURATION,
address(0)
address(0x01)
)
),
"",
Expand Down
2 changes: 1 addition & 1 deletion crates/boundless-market/src/contracts/bytecode.rs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions crates/broker/src/market_monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ mod tests {
use alloy::{
network::EthereumWallet,
node_bindings::Anvil,
primitives::{Address, Bytes, U256},
primitives::{address, Address, Bytes, U256},
providers::{ext::AnvilApi, ProviderBuilder, WalletProvider},
signers::local::PrivateKeySigner,
sol_types::eip712_domain,
Expand Down Expand Up @@ -743,8 +743,8 @@ mod tests {
let market_address = deploy_boundless_market(
signer.address(),
provider.clone(),
Address::ZERO,
Address::ZERO,
address!("0x0000000000000000000000000000000000000001"),
address!("0x0000000000000000000000000000000000000002"),
Digest::from(ASSESSOR_GUEST_ID),
format!("file://{ASSESSOR_GUEST_PATH}"),
Some(signer.address()),
Expand Down
4 changes: 2 additions & 2 deletions crates/broker/src/order_monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ pub(crate) mod tests {
use crate::OrderStatus;
use crate::{db::SqliteDb, now_timestamp, FulfillmentType};
use alloy::node_bindings::AnvilInstance;
use alloy::primitives::Bytes;
use alloy::primitives::{address, Bytes};
use alloy::{
network::EthereumWallet,
node_bindings::Anvil,
Expand Down Expand Up @@ -1088,7 +1088,7 @@ pub(crate) mod tests {
let market_address = deploy_boundless_market(
signer.address(),
provider.clone(),
Address::ZERO,
address!("0x0000000000000000000000000000000000000001"),
hit_points,
Digest::from(ASSESSOR_GUEST_ID),
format!("file://{ASSESSOR_GUEST_PATH}"),
Expand Down
2 changes: 1 addition & 1 deletion crates/broker/src/order_picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1550,7 +1550,7 @@ pub(crate) mod tests {
let market_address = deploy_boundless_market(
signer.address(),
provider.clone(),
Address::ZERO,
address!("0x0000000000000000000000000000000000000001"),
hp_contract,
Digest::from(ASSESSOR_GUEST_ID),
format!("file://{ASSESSOR_GUEST_PATH}"),
Expand Down
Loading