Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 5 from a total of 5 transactions
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ERC721Bridge
Compiler Version
v0.8.10+commit.fc410830
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract ERC721Bridge is Ownable {
address public claimFeeReceiver;
mapping(address => bool) public isClaimFeePaid;
uint256 public claimFee;
constructor(address _claimFeeReceiver) {
claimFeeReceiver = _claimFeeReceiver;
claimFee = 0.0055 ether;
}
event OrdinalBridged(address indexed sender, uint256 tokenId, string bitcoinAddress);
function payClaimFee() external payable {
require(msg.value == claimFee, "Incorrect claim fee amount");
require(!isClaimFeePaid[msg.sender], "Claim fee already paid");
(bool success, ) = claimFeeReceiver.call{value: msg.value}("");
require(success, "Failed to transfer claim fee to receiver");
isClaimFeePaid[msg.sender] = true;
}
function bridgeERC721(uint256 tokenId, string calldata bitcoinAddress) external {
require(isClaimFeePaid[msg.sender], "Claim fee not paid");
IERC721 tokenContract = IERC721(0xcBA890b4718Fc3f67821EecE841BA314fF554A8f);
require(tokenContract.ownerOf(tokenId) == msg.sender, "You are not the owner of the token");
tokenContract.transferFrom(msg.sender, 0x000000000000000000000000000000000000dEaD, tokenId);
emit OrdinalBridged(msg.sender, tokenId, bitcoinAddress);
}
function setClaimFee(uint256 newFee) external onlyOwner {
claimFee = newFee;
}
// This function is used entirely for development purposes, it's supposed to emit the log so we can debug
// It emits that token with ID > 5000 has been bridged (No inscriptions are tied with this, so it's safe to test with this)
function testCall(uint256 tokenId, string calldata bitcoinAddress) external onlyOwner {
require(tokenId >= 5000, "Use non-existant Ordinal ID");
emit OrdinalBridged(msg.sender, tokenId, bitcoinAddress);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_claimFeeReceiver","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"string","name":"bitcoinAddress","type":"string"}],"name":"OrdinalBridged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"bitcoinAddress","type":"string"}],"name":"bridgeERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimFeeReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isClaimFeePaid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"payClaimFee","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"setClaimFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"bitcoinAddress","type":"string"}],"name":"testCall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b506040516109e93803806109e983398101604081905261002f916100b8565b61003833610068565b600180546001600160a01b0319166001600160a01b039290921691909117905566138a388a43c0006003556100e8565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100ca57600080fd5b81516001600160a01b03811681146100e157600080fd5b9392505050565b6108f2806100f76000396000f3fe6080604052600436106100915760003560e01c806391587d401161005957806391587d401461012c57806399d32fc41461014c578063dfaadd3114610170578063f2fde38b14610190578063f8575821146101b057600080fd5b80630383e814146100965780632deadc7f146100a05780632e75ab50146100c0578063715018a6146100e05780638da5cb5b146100f5575b600080fd5b61009e6101f0565b005b3480156100ac57600080fd5b5061009e6100bb366004610766565b610370565b3480156100cc57600080fd5b5061009e6100db3660046107e2565b610436565b3480156100ec57600080fd5b5061009e610465565b34801561010157600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b34801561013857600080fd5b5061009e610147366004610766565b61049b565b34801561015857600080fd5b5061016260035481565b604051908152602001610123565b34801561017c57600080fd5b5060015461010f906001600160a01b031681565b34801561019c57600080fd5b5061009e6101ab366004610810565b61067b565b3480156101bc57600080fd5b506101e06101cb366004610810565b60026020526000908152604090205460ff1681565b6040519015158152602001610123565b60035434146102465760405162461bcd60e51b815260206004820152601a60248201527f496e636f727265637420636c61696d2066656520616d6f756e7400000000000060448201526064015b60405180910390fd5b3360009081526002602052604090205460ff161561029f5760405162461bcd60e51b815260206004820152601660248201527510db185a5b4819995948185b1c9958591e481c185a5960521b604482015260640161023d565b6001546040516000916001600160a01b03169034908381818185875af1925050503d80600081146102ec576040519150601f19603f3d011682016040523d82523d6000602084013e6102f1565b606091505b50509050806103535760405162461bcd60e51b815260206004820152602860248201527f4661696c656420746f207472616e7366657220636c61696d2066656520746f206044820152673932b1b2b4bb32b960c11b606482015260840161023d565b50336000908152600260205260409020805460ff19166001179055565b6000546001600160a01b0316331461039a5760405162461bcd60e51b815260040161023d90610834565b6113888310156103ec5760405162461bcd60e51b815260206004820152601b60248201527f557365206e6f6e2d6578697374616e74204f7264696e616c2049440000000000604482015260640161023d565b336001600160a01b03167f3a42976d9f6e9dac3c80e76711bcb2128378317894a2d88c1d44c5b3fae03bc184848460405161042993929190610869565b60405180910390a2505050565b6000546001600160a01b031633146104605760405162461bcd60e51b815260040161023d90610834565b600355565b6000546001600160a01b0316331461048f5760405162461bcd60e51b815260040161023d90610834565b6104996000610716565b565b3360009081526002602052604090205460ff166104ef5760405162461bcd60e51b815260206004820152601260248201527110db185a5b48199959481b9bdd081c185a5960721b604482015260640161023d565b6040516331a9108f60e11b81526004810184905273cba890b4718fc3f67821eece841ba314ff554a8f9033908290636352211e90602401602060405180830381865afa158015610543573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610567919061089f565b6001600160a01b0316146105c85760405162461bcd60e51b815260206004820152602260248201527f596f7520617265206e6f7420746865206f776e6572206f662074686520746f6b60448201526132b760f11b606482015260840161023d565b6040516323b872dd60e01b815233600482015261dead6024820152604481018590526001600160a01b038216906323b872dd90606401600060405180830381600087803b15801561061857600080fd5b505af115801561062c573d6000803e3d6000fd5b50505050336001600160a01b03167f3a42976d9f6e9dac3c80e76711bcb2128378317894a2d88c1d44c5b3fae03bc185858560405161066d93929190610869565b60405180910390a250505050565b6000546001600160a01b031633146106a55760405162461bcd60e51b815260040161023d90610834565b6001600160a01b03811661070a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161023d565b61071381610716565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060006040848603121561077b57600080fd5b83359250602084013567ffffffffffffffff8082111561079a57600080fd5b818601915086601f8301126107ae57600080fd5b8135818111156107bd57600080fd5b8760208285010111156107cf57600080fd5b6020830194508093505050509250925092565b6000602082840312156107f457600080fd5b5035919050565b6001600160a01b038116811461071357600080fd5b60006020828403121561082257600080fd5b813561082d816107fb565b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b6000602082840312156108b157600080fd5b815161082d816107fb56fea2646970667358221220a940ce974ace60b10851073b83b516dc70b8e9e16a3799b13d0a6e92b9b4635764736f6c634300080a00330000000000000000000000000640f496474bd757949b007dc987b63b0d4c5a4f
Deployed Bytecode
0x6080604052600436106100915760003560e01c806391587d401161005957806391587d401461012c57806399d32fc41461014c578063dfaadd3114610170578063f2fde38b14610190578063f8575821146101b057600080fd5b80630383e814146100965780632deadc7f146100a05780632e75ab50146100c0578063715018a6146100e05780638da5cb5b146100f5575b600080fd5b61009e6101f0565b005b3480156100ac57600080fd5b5061009e6100bb366004610766565b610370565b3480156100cc57600080fd5b5061009e6100db3660046107e2565b610436565b3480156100ec57600080fd5b5061009e610465565b34801561010157600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b34801561013857600080fd5b5061009e610147366004610766565b61049b565b34801561015857600080fd5b5061016260035481565b604051908152602001610123565b34801561017c57600080fd5b5060015461010f906001600160a01b031681565b34801561019c57600080fd5b5061009e6101ab366004610810565b61067b565b3480156101bc57600080fd5b506101e06101cb366004610810565b60026020526000908152604090205460ff1681565b6040519015158152602001610123565b60035434146102465760405162461bcd60e51b815260206004820152601a60248201527f496e636f727265637420636c61696d2066656520616d6f756e7400000000000060448201526064015b60405180910390fd5b3360009081526002602052604090205460ff161561029f5760405162461bcd60e51b815260206004820152601660248201527510db185a5b4819995948185b1c9958591e481c185a5960521b604482015260640161023d565b6001546040516000916001600160a01b03169034908381818185875af1925050503d80600081146102ec576040519150601f19603f3d011682016040523d82523d6000602084013e6102f1565b606091505b50509050806103535760405162461bcd60e51b815260206004820152602860248201527f4661696c656420746f207472616e7366657220636c61696d2066656520746f206044820152673932b1b2b4bb32b960c11b606482015260840161023d565b50336000908152600260205260409020805460ff19166001179055565b6000546001600160a01b0316331461039a5760405162461bcd60e51b815260040161023d90610834565b6113888310156103ec5760405162461bcd60e51b815260206004820152601b60248201527f557365206e6f6e2d6578697374616e74204f7264696e616c2049440000000000604482015260640161023d565b336001600160a01b03167f3a42976d9f6e9dac3c80e76711bcb2128378317894a2d88c1d44c5b3fae03bc184848460405161042993929190610869565b60405180910390a2505050565b6000546001600160a01b031633146104605760405162461bcd60e51b815260040161023d90610834565b600355565b6000546001600160a01b0316331461048f5760405162461bcd60e51b815260040161023d90610834565b6104996000610716565b565b3360009081526002602052604090205460ff166104ef5760405162461bcd60e51b815260206004820152601260248201527110db185a5b48199959481b9bdd081c185a5960721b604482015260640161023d565b6040516331a9108f60e11b81526004810184905273cba890b4718fc3f67821eece841ba314ff554a8f9033908290636352211e90602401602060405180830381865afa158015610543573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610567919061089f565b6001600160a01b0316146105c85760405162461bcd60e51b815260206004820152602260248201527f596f7520617265206e6f7420746865206f776e6572206f662074686520746f6b60448201526132b760f11b606482015260840161023d565b6040516323b872dd60e01b815233600482015261dead6024820152604481018590526001600160a01b038216906323b872dd90606401600060405180830381600087803b15801561061857600080fd5b505af115801561062c573d6000803e3d6000fd5b50505050336001600160a01b03167f3a42976d9f6e9dac3c80e76711bcb2128378317894a2d88c1d44c5b3fae03bc185858560405161066d93929190610869565b60405180910390a250505050565b6000546001600160a01b031633146106a55760405162461bcd60e51b815260040161023d90610834565b6001600160a01b03811661070a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161023d565b61071381610716565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060006040848603121561077b57600080fd5b83359250602084013567ffffffffffffffff8082111561079a57600080fd5b818601915086601f8301126107ae57600080fd5b8135818111156107bd57600080fd5b8760208285010111156107cf57600080fd5b6020830194508093505050509250925092565b6000602082840312156107f457600080fd5b5035919050565b6001600160a01b038116811461071357600080fd5b60006020828403121561082257600080fd5b813561082d816107fb565b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b6000602082840312156108b157600080fd5b815161082d816107fb56fea2646970667358221220a940ce974ace60b10851073b83b516dc70b8e9e16a3799b13d0a6e92b9b4635764736f6c634300080a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000640f496474bd757949b007dc987b63b0d4c5a4f
-----Decoded View---------------
Arg [0] : _claimFeeReceiver (address): 0x0640f496474Bd757949B007DC987B63B0d4c5A4F
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000640f496474bd757949b007dc987b63b0d4c5a4f
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.