-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c171e46
commit 57602af
Showing
10 changed files
with
142 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,6 @@ | |
pragma solidity ^0.8.0; | ||
|
||
import "./Order.sol"; | ||
import "../NFTexchangeCore.sol"; | ||
|
||
|
||
library State { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import "@openzeppelin/contracts/access/Ownable.sol"; | ||
|
||
abstract contract marketmanage is Ownable { | ||
|
||
address owner; | ||
address protcolfee; | ||
|
||
function | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
contracts/Tokens/LazyMint/signtureEIP712/signtureERC1155.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
|
||
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; | ||
import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol"; | ||
|
||
abstract contract signtureERC1155 is EIP712 { | ||
using ECDSA for bytes32; | ||
|
||
|
||
struct NFTVoucher { | ||
uint256 tokenId; | ||
uint256 minPrice; | ||
uint256 supply; | ||
address account; | ||
string uri; | ||
} | ||
|
||
constructor () | ||
EIP712("LazyNFT-Voucher", "1") | ||
{ | ||
|
||
} | ||
|
||
function _hash(NFTVoucher calldata voucher) internal view returns (bytes32) { | ||
return _hashTypedDataV4(keccak256(abi.encode( | ||
keccak256("NFTVoucher(uint256 tokenId,uint256 minPrice,uint256 supply,address account,string uri)"), | ||
voucher.tokenId, | ||
voucher.minPrice, | ||
voucher.supply, | ||
voucher.account, | ||
keccak256(bytes(voucher.uri)) | ||
))); | ||
} | ||
|
||
|
||
function _verify(NFTVoucher calldata voucher, bytes memory signature) internal view returns (address) { | ||
bytes32 digest = _hash(voucher); | ||
return digest.toEthSignedMessageHash().recover(signature); | ||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
contracts/Tokens/LazyMint/signtureEIP712/signtureERC721.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
|
||
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; | ||
import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol"; | ||
|
||
abstract contract signtureERC721 is EIP712 { | ||
using ECDSA for bytes32; | ||
|
||
|
||
struct NFTVoucher { | ||
uint256 tokenId; | ||
uint256 minPrice; | ||
string uri; | ||
} | ||
|
||
constructor () | ||
EIP712("LazyNFT-Voucher", "1") | ||
{ | ||
|
||
} | ||
|
||
function _hash(NFTVoucher calldata voucher) internal view returns (bytes32) { | ||
return _hashTypedDataV4(keccak256(abi.encode( | ||
keccak256("NFTVoucher(uint256 tokenId,uint256 minPrice,string uri)"), | ||
voucher.tokenId, | ||
voucher.minPrice, | ||
keccak256(bytes(voucher.uri)) | ||
))); | ||
} | ||
|
||
|
||
function _verify(NFTVoucher calldata voucher, bytes memory signature) internal view returns (address) { | ||
bytes32 digest = _hash(voucher); | ||
return digest.toEthSignedMessageHash().recover(signature); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const { deployProxy } = require('@openzeppelin/truffle-upgrades'); | ||
|
||
const NFTexchange = artifacts.require('NFTexchange'); | ||
|
||
module.exports = async function (deployer) { | ||
const instance = await deployProxy(NFTexchange, { deployer }); | ||
console.log('Deployed', instance.address); | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters