Skip to content

Commit

Permalink
Add EVM Contracts (#637)
Browse files Browse the repository at this point in the history
* add contracts

* add ens

* update erc721

* Add AssetsBridgeErc20 contracts

* Add ens contracts

* Add chainx mainnet

* remove notes

Co-authored-by: NingBo Wang <2536935847@qq.com>
Co-authored-by: icodezjb <icodezjb@users.noreply.github.com>
  • Loading branch information
3 people authored Jun 1, 2022
1 parent 5c9399a commit caca57a
Show file tree
Hide file tree
Showing 54 changed files with 11,742 additions and 0 deletions.
53 changes: 53 additions & 0 deletions contracts/AssetsBridgeAdaptor.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.4.1/contracts/utils/Context.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.4.1/contracts/access/Ownable.sol";

/**
* @dev Interface of the SherpaX AssetsBridge
*/
interface IAssetsBridge {
/*
* @dev mint the token to account for assets bridge admin.
* @param account The receiver of token.
* @param amount The amount of token.
*/
function mint_into(address account, uint256 amount) external returns (bool);

/*
* @dev burn the token from account for assets bridge admin.
* @param account The owner of token.
* @param amount The amount of token.
*/
function burn_from(address account, uint256 amount) external returns (bool);
}

abstract contract AssetsBridgeAdmin is Context {
address public constant admin = 0x1111111111111111111111111111111111111111;

modifier AssetsBridgeRequire() {
require(_msgSender() == admin, "AssetsBridge: require called by the assets bridge admin address");

_;
}
}

abstract contract AssetsBridgeOwner is Context, Ownable {
modifier AssetsBridgeRequire() {
require(_msgSender() == owner(), "AssetsBridge: require called by owner");

_;
}
}

abstract contract AssetsBridgeAdminOrOwner is Context, Ownable {
address public constant admin = 0x1111111111111111111111111111111111111111;

modifier AssetsBridgeRequire() {
require(_msgSender() == owner() || _msgSender() == admin, "AssetsBridge: require called by owner or admin");

_;
}
}
Loading

0 comments on commit caca57a

Please sign in to comment.