Skip to content

Commit

Permalink
Migrate to lsp contract 0.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lykhonis committed Dec 1, 2023
1 parent 3f8c7c1 commit e6454d0
Show file tree
Hide file tree
Showing 24 changed files with 77 additions and 43 deletions.
2 changes: 1 addition & 1 deletion lib/lsp-smart-contracts
3 changes: 2 additions & 1 deletion src/assets/lsp7/GenesisDigitalAsset.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pragma solidity 0.8.17;

import {LSP7DigitalAsset} from "@lukso/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol";
import {_LSP4_TOKEN_TYPE_NFT} from "@lukso/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol";

contract GenesisDigitalAsset is LSP7DigitalAsset {
error InvalidBeneficiary();
Expand All @@ -12,7 +13,7 @@ contract GenesisDigitalAsset is LSP7DigitalAsset {
address public beneficiary;

constructor(string memory name_, string memory symbol_, address newOwner_, address newBeneficiary_)
LSP7DigitalAsset(name_, symbol_, newOwner_, true)
LSP7DigitalAsset(name_, symbol_, newOwner_, _LSP4_TOKEN_TYPE_NFT, true)
{
_setBeneficiary(newBeneficiary_);
}
Expand Down
3 changes: 2 additions & 1 deletion src/assets/lsp7/MintableDigitalAsset.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ contract MintableDigitalAsset is LSP7Mintable, LSP7CappedSupply {
string memory name_,
string memory symbol_,
address newOwner_,
uint256 lsp4TokenType_,
bool isNonDivisible_,
uint256 tokenSupplyCap_
) LSP7Mintable(name_, symbol_, newOwner_, isNonDivisible_) LSP7CappedSupply(tokenSupplyCap_) {}
) LSP7Mintable(name_, symbol_, newOwner_, lsp4TokenType_, isNonDivisible_) LSP7CappedSupply(tokenSupplyCap_) {}

function _mint(address to, uint256 amount, bool allowNonLSP1Recipient, bytes memory data)
internal
Expand Down
7 changes: 4 additions & 3 deletions src/assets/lsp8/CollectorIdentifiableDigitalAsset.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ import {LSP8Enumerable} from
"@lukso/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol";
import {LSP8IdentifiableDigitalAssetCore} from
"@lukso/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol";
import {_LSP8_TOKENID_SCHEMA_UNIQUE_ID} from
"@lukso/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol";
import {_LSP4_TOKEN_TYPE_NFT} from "@lukso/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol";
import {Withdrawable} from "../../common/Withdrawable.sol";
import {ICollectorIdentifiableDigitalAsset} from "./ICollectorIdentifiableDigitalAsset.sol";

uint256 constant _LSP8_TOKEN_ID_TYPE_UNIQUE_IDENTIFIER = 2;

contract CollectorIdentifiableDigitalAsset is
ICollectorIdentifiableDigitalAsset,
LSP8IdentifiableDigitalAsset,
Expand Down Expand Up @@ -52,7 +53,7 @@ contract CollectorIdentifiableDigitalAsset is
address controller_,
uint256 tokenSupplyCap_
)
LSP8IdentifiableDigitalAsset(name_, symbol_, newOwner_, _LSP8_TOKEN_ID_TYPE_UNIQUE_IDENTIFIER)
LSP8IdentifiableDigitalAsset(name_, symbol_, newOwner_, _LSP4_TOKEN_TYPE_NFT, _LSP8_TOKENID_SCHEMA_UNIQUE_ID)
LSP8CappedSupply(tokenSupplyCap_)
{
_setController(controller_);
Expand Down
3 changes: 2 additions & 1 deletion src/assets/lsp8/MintableIdentifiableDigitalAsset.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ contract MintableIdentifiableDigitalAsset is LSP8Mintable, LSP8Enumerable, LSP8C
string memory symbol_,
address newOwner_,
uint256 tokenIdType_,
uint256 lsp8TokenIdSchema_,
uint256 tokenSupplyCap_
) LSP8Mintable(name_, symbol_, newOwner_, tokenIdType_) LSP8CappedSupply(tokenSupplyCap_) {
) LSP8Mintable(name_, symbol_, newOwner_, tokenIdType_, lsp8TokenIdSchema_) LSP8CappedSupply(tokenSupplyCap_) {
// noop
}

Expand Down
3 changes: 2 additions & 1 deletion src/drops/LSP7DropsDigitalAsset.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
LSP7DigitalAssetCore
} from "@lukso/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol";
import {LSP7CappedSupply} from "@lukso/lsp-smart-contracts/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol";
import {_LSP4_TOKEN_TYPE_NFT} from "@lukso/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol";
import {DropsDigitalAsset} from "./DropsDigitalAsset.sol";

contract LSP7DropsDigitalAsset is LSP7CappedSupply, DropsDigitalAsset {
Expand All @@ -20,7 +21,7 @@ contract LSP7DropsDigitalAsset is LSP7CappedSupply, DropsDigitalAsset {
uint256 tokenSupplyCap_,
uint32 serviceFeePoints_
)
LSP7DigitalAsset(name_, symbol_, newOwner_, true)
LSP7DigitalAsset(name_, symbol_, newOwner_, _LSP4_TOKEN_TYPE_NFT, true)
LSP7CappedSupply(tokenSupplyCap_)
DropsDigitalAsset(service_, verifier_, serviceFeePoints_)
{}
Expand Down
3 changes: 2 additions & 1 deletion src/drops/LSP8DropsDigitalAsset.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {LSP8CappedSupply} from
"@lukso/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol";
import {LSP8Enumerable} from
"@lukso/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol";
import {_LSP4_TOKEN_TYPE_NFT} from "@lukso/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol";
import {DropsDigitalAsset} from "./DropsDigitalAsset.sol";

contract LSP8DropsDigitalAsset is LSP8CappedSupply, LSP8Enumerable, DropsDigitalAsset {
Expand All @@ -35,7 +36,7 @@ contract LSP8DropsDigitalAsset is LSP8CappedSupply, LSP8Enumerable, DropsDigital
uint256 tokenSupplyCap_,
uint32 serviceFeePoints_
)
LSP8IdentifiableDigitalAsset(name_, symbol_, newOwner_, _LSP8_TOKEN_ID_TYPE_UNIQUE_NUMBER)
LSP8IdentifiableDigitalAsset(name_, symbol_, newOwner_, _LSP4_TOKEN_TYPE_NFT, _LSP8_TOKEN_ID_TYPE_UNIQUE_NUMBER)
LSP8CappedSupply(tokenSupplyCap_)
DropsDigitalAsset(service_, verifier_, serviceFeePoints_)
{
Expand Down
7 changes: 4 additions & 3 deletions src/page/PageName.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ pragma solidity 0.8.17;
import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import {_LSP4_TOKEN_TYPE_NFT} from "@lukso/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol";
import {_LSP8_TOKENID_SCHEMA_STRING} from
"@lukso/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol";
import {LSP8EnumerableInitAbstract} from
"@lukso/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol";
import {LSP8IdentifiableDigitalAssetInitAbstract} from
"@lukso/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol";
import {Withdrawable} from "../common/Withdrawable.sol";
import {IPageNameMarketplace, PendingSale} from "./IPageNameMarketplace.sol";

uint256 constant _LSP8_TOKEN_ID_TYPE_UNIQUE_NAME = 1;

contract PageName is LSP8EnumerableInitAbstract, ReentrancyGuardUpgradeable, PausableUpgradeable, Withdrawable {
error InvalidController();

Expand Down Expand Up @@ -52,7 +53,7 @@ contract PageName is LSP8EnumerableInitAbstract, ReentrancyGuardUpgradeable, Pau
uint16 profileLimit_,
IPageNameMarketplace marketplace_
) external initializer {
super._initialize(name_, symbol_, newOwner_, _LSP8_TOKEN_ID_TYPE_UNIQUE_NAME);
super._initialize(name_, symbol_, newOwner_, _LSP4_TOKEN_TYPE_NFT, _LSP8_TOKENID_SCHEMA_STRING);
__ReentrancyGuard_init();
__Pausable_init();
_setBeneficiary(beneficiary_);
Expand Down
3 changes: 2 additions & 1 deletion test/assets/lsp7/DigitalAssetDrop.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pragma solidity 0.8.17;
import {Test} from "forge-std/Test.sol";
import {Merkle} from "murky/Merkle.sol";
import {UniversalProfile} from "@lukso/lsp-smart-contracts/contracts/UniversalProfile.sol";
import {_LSP4_TOKEN_TYPE_NFT} from "@lukso/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol";
import {DigitalAssetDrop} from "../../../src/assets/lsp7/DigitalAssetDrop.sol";
import {deployProfile} from "../../utils/profile.sol";
import {DigitalAssetMock} from "./DigitalAssetMock.sol";
Expand All @@ -24,7 +25,7 @@ contract DigitalAssetDropTest is Test {
dropOwner = vm.addr(3);

merkle = new Merkle();
asset = new DigitalAssetMock("Mock", "MCK", assetOwner, true);
asset = new DigitalAssetMock("Mock", "MCK", assetOwner, _LSP4_TOKEN_TYPE_NFT, true);
}

function test_Claim() public {
Expand Down
10 changes: 7 additions & 3 deletions test/assets/lsp7/DigitalAssetMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ pragma solidity 0.8.17;
import {LSP7DigitalAsset} from "@lukso/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol";

contract DigitalAssetMock is LSP7DigitalAsset {
constructor(string memory name_, string memory symbol_, address newOwner_, bool isNonDivisible_)
LSP7DigitalAsset(name_, symbol_, newOwner_, isNonDivisible_)
{}
constructor(
string memory name_,
string memory symbol_,
address newOwner_,
uint256 lsp4TokenType_,
bool isNonDivisible_
) LSP7DigitalAsset(name_, symbol_, newOwner_, lsp4TokenType_, isNonDivisible_) {}

function mint(address to, uint256 amount, bool allowNonLSP1Recipient, bytes memory data) external {
_mint(to, amount, allowNonLSP1Recipient, data);
Expand Down
8 changes: 6 additions & 2 deletions test/assets/lsp7/MintableDigitalAsset.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ pragma solidity 0.8.17;

import {Test} from "forge-std/Test.sol";
import {UniversalProfile} from "@lukso/lsp-smart-contracts/contracts/UniversalProfile.sol";
import {
_LSP4_TOKEN_TYPE_TOKEN,
_LSP4_TOKEN_TYPE_NFT
} from "@lukso/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol";
import {MintableDigitalAsset} from "../../../src/assets/lsp7/MintableDigitalAsset.sol";

contract MintableDigitalAssetTest is Test {
Expand All @@ -13,15 +17,15 @@ contract MintableDigitalAssetTest is Test {
}

function test_NonDivisble() public {
MintableDigitalAsset asset = new MintableDigitalAsset("Test", "TST", owner, true, 100);
MintableDigitalAsset asset = new MintableDigitalAsset("Test", "TST", owner, _LSP4_TOKEN_TYPE_NFT, true, 100);
assertEq(0, asset.totalSupply());
assertEq(100, asset.tokenSupplyCap());
assertEq(owner, asset.owner());
assertEq(0, asset.decimals());
}

function test_Divisible() public {
MintableDigitalAsset asset = new MintableDigitalAsset("Test", "TST", owner, false, 100);
MintableDigitalAsset asset = new MintableDigitalAsset("Test", "TST", owner, _LSP4_TOKEN_TYPE_TOKEN, false, 100);
assertEq(0, asset.totalSupply());
assertEq(100, asset.tokenSupplyCap());
assertEq(owner, asset.owner());
Expand Down
13 changes: 9 additions & 4 deletions test/assets/lsp8/CollectorIdentifiableDigitalAsset.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ import {Test} from "forge-std/Test.sol";
import {UniversalProfile} from "@lukso/lsp-smart-contracts/contracts/UniversalProfile.sol";
import {
_LSP4_TOKEN_NAME_KEY,
_LSP4_TOKEN_SYMBOL_KEY
_LSP4_TOKEN_SYMBOL_KEY,
_LSP4_TOKEN_TYPE_KEY,
_LSP4_TOKEN_TYPE_NFT
} from "@lukso/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol";
import {
_LSP8_TOKENID_SCHEMA_KEY,
_LSP8_TOKENID_SCHEMA_UNIQUE_ID
} from "@lukso/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol";
import {CollectorIdentifiableDigitalAsset} from "../../../src/assets/lsp8/CollectorIdentifiableDigitalAsset.sol";
import {deployProfile} from "../../utils/profile.sol";

bytes32 constant _LSP8_TOKEN_ID_TYPE_KEY = 0x715f248956de7ce65e94d9d836bfead479f7e70d69b718d47bfe7b00e05b4fe4;

contract CollectorIdentifiableDigitalAssetTest is Test {
event TokensPurchased(address indexed recipient, bytes32[] tokenIds, uint256 totalPaid);
event TokenSupplyLimitChanged(uint256 limit);
Expand All @@ -35,7 +39,8 @@ contract CollectorIdentifiableDigitalAssetTest is Test {
function test_Initialize() public {
assertEq("Universal Page Collector", asset.getData(_LSP4_TOKEN_NAME_KEY));
assertEq("UPC", asset.getData(_LSP4_TOKEN_SYMBOL_KEY));
assertEq(2, /* unuque identifier/sequence */ uint256(bytes32(asset.getData(_LSP8_TOKEN_ID_TYPE_KEY))));
assertEq(_LSP4_TOKEN_TYPE_NFT, uint256(bytes32(asset.getData(_LSP4_TOKEN_TYPE_KEY))));
assertEq(_LSP8_TOKENID_SCHEMA_UNIQUE_ID, uint256(bytes32(asset.getData(_LSP8_TOKENID_SCHEMA_KEY))));
assertEq(0, asset.totalSupply());
assertEq(100, asset.tokenSupplyCap());
assertEq(0, asset.tokenSupplyLimit());
Expand Down
2 changes: 1 addition & 1 deletion test/assets/lsp8/MintableIdentifiableDigitalAsset.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contract MintableIdentifiableDigitalAssetTest is Test {
}

function test() public {
MintableIdentifiableDigitalAsset asset = new MintableIdentifiableDigitalAsset("Test", "TST", owner, 1, 100);
MintableIdentifiableDigitalAsset asset = new MintableIdentifiableDigitalAsset("Test", "TST", owner, 1, 1, 100);
assertEq(0, asset.totalSupply());
assertEq(100, asset.tokenSupplyCap());
assertEq(owner, asset.owner());
Expand Down
2 changes: 1 addition & 1 deletion test/marketplace/Participant.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ contract ParticipantTest is Test {
controllerKey = 4;
controller = vm.addr(controllerKey);

genesisAsset = new LSP7DigitalAssetMock("Mock", "MCK", assetOwner, true);
genesisAsset = new LSP7DigitalAssetMock("Mock", "MCK", assetOwner, 0, true);
collectorAsset =
new CollectorIdentifiableDigitalAsset("Universal Page Collector", "UPC", assetOwner, controller, 1000);

Expand Down
10 changes: 7 additions & 3 deletions test/marketplace/lsp7/LSP7DigitalAssetMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ pragma solidity 0.8.17;
import {LSP7DigitalAsset} from "@lukso/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol";

contract LSP7DigitalAssetMock is LSP7DigitalAsset {
constructor(string memory name_, string memory symbol_, address newOwner_, bool isNonDivisible_)
LSP7DigitalAsset(name_, symbol_, newOwner_, isNonDivisible_)
{}
constructor(
string memory name_,
string memory symbol_,
address newOwner_,
uint256 lsp4TokenType_,
bool isNonDivisible_
) LSP7DigitalAsset(name_, symbol_, newOwner_, lsp4TokenType_, isNonDivisible_) {}

function mint(address to, uint256 amount, bool allowNonLSP1Recipient, bytes memory data) external {
_mint(to, amount, allowNonLSP1Recipient, data);
Expand Down
2 changes: 1 addition & 1 deletion test/marketplace/lsp7/LSP7Listings.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ contract LSP7ListingsTest is Test {
admin = vm.addr(1);
owner = vm.addr(2);

asset = new LSP7DigitalAssetMock("Mock", "MCK", owner, true);
asset = new LSP7DigitalAssetMock("Mock", "MCK", owner, 0, true);

listings = LSP7Listings(
address(
Expand Down
4 changes: 2 additions & 2 deletions test/marketplace/lsp7/LSP7Marketplace.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ contract LSP7MarketplaceTest is Test {
owner = vm.addr(2);
beneficiary = vm.addr(3);

asset = new LSP7DigitalAssetMock("Mock", "MCK", owner, true);
asset = new LSP7DigitalAssetMock("Mock", "MCK", owner, 0, true);

participant = Participant(
payable(
Expand Down Expand Up @@ -208,7 +208,7 @@ contract LSP7MarketplaceTest is Test {
}

function test_BuyWithDiscount() public {
LSP7DigitalAssetMock discountAsset = new LSP7DigitalAssetMock("Discount", "DSC", owner, true);
LSP7DigitalAssetMock discountAsset = new LSP7DigitalAssetMock("Discount", "DSC", owner, 0, true);
vm.prank(owner);
participant.setGenesisAsset(discountAsset);

Expand Down
2 changes: 1 addition & 1 deletion test/marketplace/lsp7/LSP7Offers.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ contract LSP7OffersTest is Test {
admin = vm.addr(1);
owner = vm.addr(2);

asset = new LSP7DigitalAssetMock("Mock", "MCK", owner, true);
asset = new LSP7DigitalAssetMock("Mock", "MCK", owner, 0, true);

listings = LSP7Listings(
address(
Expand Down
2 changes: 1 addition & 1 deletion test/marketplace/lsp8/LSP8Auctions.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ contract LSP8AuctionsTest is Test {
admin = vm.addr(1);
owner = vm.addr(2);

asset = new LSP8DigitalAssetMock("Mock", "MCK", owner, 0);
asset = new LSP8DigitalAssetMock("Mock", "MCK", owner, 0, 0);

listings = LSP8Listings(
address(
Expand Down
10 changes: 7 additions & 3 deletions test/marketplace/lsp8/LSP8DigitalAssetMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ import {LSP8IdentifiableDigitalAsset} from
"@lukso/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol";

contract LSP8DigitalAssetMock is LSP8IdentifiableDigitalAsset {
constructor(string memory name_, string memory symbol_, address newOwner_, uint256 tokenIdType_)
LSP8IdentifiableDigitalAsset(name_, symbol_, newOwner_, tokenIdType_)
{
constructor(
string memory name_,
string memory symbol_,
address newOwner_,
uint256 tokenIdType_,
uint256 lsp8TokenIdSchema_
) LSP8IdentifiableDigitalAsset(name_, symbol_, newOwner_, tokenIdType_, lsp8TokenIdSchema_) {
// noop
}

Expand Down
2 changes: 1 addition & 1 deletion test/marketplace/lsp8/LSP8Listings.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ contract LSP8ListingsTest is Test {
admin = vm.addr(1);
owner = vm.addr(2);

asset = new LSP8DigitalAssetMock("Mock", "MCK", owner, 0);
asset = new LSP8DigitalAssetMock("Mock", "MCK", owner, 0, 0);

listings = LSP8Listings(
address(
Expand Down
4 changes: 2 additions & 2 deletions test/marketplace/lsp8/LSP8Marketplace.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ contract LSP8MarketplaceTest is Test {
owner = vm.addr(2);
beneficiary = vm.addr(3);

asset = new LSP8DigitalAssetMock("Mock", "MCK", owner, 0);
asset = new LSP8DigitalAssetMock("Mock", "MCK", owner, 0, 0);

participant = Participant(
payable(
Expand Down Expand Up @@ -218,7 +218,7 @@ contract LSP8MarketplaceTest is Test {
}

function test_BuyWithDiscount() public {
LSP7DigitalAssetMock discountAsset = new LSP7DigitalAssetMock("Discount", "DSC", owner, true);
LSP7DigitalAssetMock discountAsset = new LSP7DigitalAssetMock("Discount", "DSC", owner, 0, true);
vm.prank(owner);
participant.setGenesisAsset(discountAsset);

Expand Down
2 changes: 1 addition & 1 deletion test/marketplace/lsp8/LSP8Offers.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ contract LSP8OffersTest is Test {
admin = vm.addr(1);
owner = vm.addr(2);

asset = new LSP8DigitalAssetMock("Mock", "MCK", owner, 0);
asset = new LSP8DigitalAssetMock("Mock", "MCK", owner, 0, 0);

listings = LSP8Listings(
address(
Expand Down
13 changes: 9 additions & 4 deletions test/page/PageName.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ import {Test} from "forge-std/Test.sol";
import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
import {
_LSP4_TOKEN_NAME_KEY,
_LSP4_TOKEN_SYMBOL_KEY
_LSP4_TOKEN_SYMBOL_KEY,
_LSP4_TOKEN_TYPE_KEY,
_LSP4_TOKEN_TYPE_NFT
} from "@lukso/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol";
import {
_LSP8_TOKENID_SCHEMA_KEY,
_LSP8_TOKENID_SCHEMA_STRING
} from "@lukso/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol";
import {UniversalProfile} from "@lukso/lsp-smart-contracts/contracts/UniversalProfile.sol";
import {IPageNameMarketplace, PendingSale} from "../../src/page/IPageNameMarketplace.sol";
import {PageName} from "../../src/page/PageName.sol";
import {deployProfile} from "../utils/profile.sol";
import {PageNameMarketplaceMock} from "./PageNameMarketplaceMock.sol";

bytes32 constant _LSP8_TOKEN_ID_TYPE_KEY = 0x715f248956de7ce65e94d9d836bfead479f7e70d69b718d47bfe7b00e05b4fe4;

contract PageNameTest is Test {
event ValueReceived(address indexed sender, uint256 indexed value);
event ValueWithdrawn(address indexed sender, uint256 indexed value);
Expand Down Expand Up @@ -63,7 +67,8 @@ contract PageNameTest is Test {
assertTrue(!name.paused());
assertEq("Universal Page Name", name.getData(_LSP4_TOKEN_NAME_KEY));
assertEq("UPN", name.getData(_LSP4_TOKEN_SYMBOL_KEY));
assertEq(1, /* string */ uint256(bytes32(name.getData(_LSP8_TOKEN_ID_TYPE_KEY))));
assertEq(_LSP4_TOKEN_TYPE_NFT, uint256(bytes32(name.getData(_LSP4_TOKEN_TYPE_KEY))));
assertEq(_LSP8_TOKENID_SCHEMA_STRING, uint256(bytes32(name.getData(_LSP8_TOKENID_SCHEMA_KEY))));
assertEq(owner, name.owner());
assertEq(beneficiary, name.beneficiary());
assertEq(controller, name.controller());
Expand Down

0 comments on commit e6454d0

Please sign in to comment.