forked from PundiAI/fx-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add bridge call contract (PundiAI#102)
- Loading branch information
Showing
17 changed files
with
4,537 additions
and
5,498 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 |
---|---|---|
|
@@ -12,4 +12,5 @@ local.* | |
release-note.md | ||
artifacts | ||
dist | ||
out | ||
out | ||
typechain-types |
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 |
---|---|---|
|
@@ -6,4 +6,7 @@ cache | |
.env | ||
contracts/LICENSE | ||
contracts/README.md | ||
contracts/build | ||
contracts/build | ||
typechain-types | ||
artifacts | ||
*.log |
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 |
---|---|---|
|
@@ -15,4 +15,4 @@ | |
], | ||
"reason-string": ["warn", { "maxLength": 64 }] | ||
} | ||
} | ||
} |
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
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
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,18 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {ERC1155} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; | ||
import {ERC1155Burnable} from "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol"; | ||
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; | ||
|
||
contract ERC1155TokenTest is ERC1155, ERC1155Burnable, Ownable { | ||
constructor(string memory uri_) ERC1155(uri_) {} | ||
|
||
function mint( | ||
address _to, | ||
uint256 _id, | ||
uint256 _amount | ||
) external onlyOwner { | ||
_mint(_to, _id, _amount, ""); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,73 +1,21 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
/* solhint-disable no-global-import */ | ||
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; | ||
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol"; | ||
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; | ||
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; | ||
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; | ||
import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol"; | ||
|
||
/* solhint-enable no-global-import */ | ||
|
||
contract ERC721TokenTest is | ||
Initializable, | ||
ERC721Upgradeable, | ||
ERC721URIStorageUpgradeable, | ||
OwnableUpgradeable, | ||
UUPSUpgradeable | ||
{ | ||
using CountersUpgradeable for CountersUpgradeable.Counter; | ||
|
||
CountersUpgradeable.Counter private _tokenIdCounter; | ||
|
||
/// @custom:oz-upgrades-unsafe-allow constructor | ||
constructor() { | ||
_disableInitializers(); | ||
} | ||
|
||
function initialize() public initializer { | ||
__ERC721_init("ERC721TokenTest", "TTT"); | ||
__ERC721URIStorage_init(); | ||
__Ownable_init(); | ||
__UUPSUpgradeable_init(); | ||
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | ||
import {ERC721Burnable} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; | ||
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; | ||
|
||
contract ERC721TokenTest is ERC721, ERC721Burnable, Ownable { | ||
constructor( | ||
string memory name, | ||
string memory symbol | ||
) ERC721(name, symbol) {} | ||
|
||
function mint(address _to, uint256 _id) external onlyOwner { | ||
_safeMint(_to, _id); | ||
} | ||
|
||
function _baseURI() internal pure override returns (string memory) { | ||
return "ipfs://test-url"; | ||
} | ||
|
||
function safeMint(address to, string memory uri) public onlyOwner { | ||
uint256 tokenId = _tokenIdCounter.current(); | ||
_tokenIdCounter.increment(); | ||
_safeMint(to, tokenId); | ||
_setTokenURI(tokenId, uri); | ||
} | ||
|
||
/* solhint-disable no-empty-blocks */ | ||
function _authorizeUpgrade( | ||
address newImplementation | ||
) internal override onlyOwner {} | ||
|
||
/* solhint-enable no-empty-blocks */ | ||
|
||
// The following functions are overrides required by Solidity. | ||
|
||
function _burn( | ||
uint256 tokenId | ||
) internal override(ERC721Upgradeable, ERC721URIStorageUpgradeable) { | ||
super._burn(tokenId); | ||
} | ||
|
||
function tokenURI( | ||
uint256 tokenId | ||
) | ||
public | ||
view | ||
override(ERC721Upgradeable, ERC721URIStorageUpgradeable) | ||
returns (string memory) | ||
{ | ||
return super.tokenURI(tokenId); | ||
} | ||
} |
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
Oops, something went wrong.