Skip to content

Commit

Permalink
fix(test): add currency admin to test (#1197)
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbeckers authored Nov 30, 2023
1 parent ccdf65b commit 1acbaa0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ const config: HardhatUserConfig = {
clear: true,
only: [
"CurrencyManager",
"ExecutionManager",
"HypercertMinter",
"LooksRareProtocol",
"OrderValidatorV2A",
Expand Down
2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hypercerts-org/contracts",
"description": "EVM compatible protocol for managing impact claims",
"version": "1.0.0-alpha.6",
"version": "1.0.0-alpha.7",
"author": {
"name": "Hypercerts Foundation",
"url": "https://github.com/hypercerts-org/hypercerts"
Expand Down
4 changes: 4 additions & 0 deletions contracts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import TransferManagerAbi from "../abi/src/marketplace/TransferManager.sol/Trans
import StrategyCollectionOfferAbi from "../abi/src/marketplace/executionStrategies/StrategyCollectionOffer.sol/StrategyCollectionOffer.json";
import StrategyHypercertFractionOfferAbi from "../abi/src/marketplace/executionStrategies/StrategyHypercertFractionOffer.sol/StrategyHypercertFractionOffer.json";
import CreatorFeeManagerWithRoyaltiesAbi from "../abi/src/marketplace/CreatorFeeManagerWithRoyalties.sol/CreatorFeeManagerWithRoyalties.json";
import ExecutionManagerAbi from "../abi/src/marketplace/ExecutionManager.sol/ExecutionManager.json";

import {
ExecutionManager,
HypercertMinter,
IHypercertToken,
LooksRareProtocol as HypercertExchange,
Expand Down Expand Up @@ -74,6 +76,7 @@ export { deployments, asDeployedChain };
// Abis
export {
CreatorFeeManagerWithRoyaltiesAbi,
ExecutionManagerAbi,
HypercertMinterAbi,
HypercertExchangeAbi,
OrderValidatorV2AAbi,
Expand All @@ -86,6 +89,7 @@ export {
// Interfaces
export type {
CreatorFeeManagerWithRoyalties,
ExecutionManager,
IHypercertExchange,
IHypercertToken,
HypercertExchange,
Expand Down
10 changes: 10 additions & 0 deletions contracts/test/foundry/marketplace/LooksRareProtocol.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ contract LooksRareProtocolTest is ProtocolBase {
_createMockMakerAskAndTakerBid(address(mockERC721));
makerAsk.currency = address(mockERC20);

mockERC20.mint(takerUser, 10 ether);
vm.prank(takerUser);
mockERC20.approve(address(looksRareProtocol), 10 ether);

// Mint asset
mockERC721.mint(makerUser, makerAsk.itemIds[0]);

Expand Down Expand Up @@ -125,6 +129,12 @@ contract LooksRareProtocolTest is ProtocolBase {
merkleTrees,
false // Non-atomic
);

vm.prank(_owner);
looksRareProtocol.updateCurrencyStatus(address(mockERC20), true);

vm.prank(takerUser);
looksRareProtocol.executeTakerBid{value: price}(takerBid, makerAsk, signature, _EMPTY_MERKLE_TREE);
}

function testCannotTradeIfETHIsUsedForMakerBid() public {
Expand Down

0 comments on commit 1acbaa0

Please sign in to comment.