Address Contract Partially Verified
Address
0x4Ed88b09Eb02504CD5df19C6786a7d5C6535d0d6
Balance
0 ETH
Nonce
1
Code Size
2795 bytes
Creator
0x8426cc3b...C5e3 at tx 0x90cf7e97...e78c63
Indexed Transactions
0 (1 on-chain, 1.0% indexed)
Contract Bytecode
2795 bytes
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806394779ee71161007157806394779ee71461013d578063955ec1e114610154578063d1efd30d14610167578063d8437ab31461017a578063e949580e1461018d578063f2fde38b146101cb57600080fd5b806324330982146100b95780632465f703146100ce5780636c19e783146100fe578063715018a614610111578063866c6358146101195780638da5cb5b1461012c575b600080fd5b6100cc6100c736600461086c565b6101de565b005b6002546100e1906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100cc61010c36600461089f565b610245565b6100cc6102bc565b6003546100e1906001600160a01b031681565b6000546001600160a01b03166100e1565b61014660015481565b6040519081526020016100f5565b6100cc610162366004610964565b6102d0565b6004546100e1906001600160a01b031681565b6100cc61018836600461086c565b6105c6565b6101bb61019b3660046109cf565b805160208183018101805160058252928201919093012091525460ff1681565b60405190151581526020016100f5565b6100cc6101d936600461089f565b6105fc565b6101e6610675565b60405163f2fde38b60e01b81526001600160a01b03828116600483015283169063f2fde38b90602401600060405180830381600087803b15801561022957600080fd5b505af115801561023d573d6000803e3d6000fd5b505050505050565b61024d610675565b6001600160a01b03811661029a5760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b60448201526064015b60405180910390fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6102c4610675565b6102ce60006106cf565b565b6103e8600154106103235760405162461bcd60e51b815260206004820152601c60248201527f6d696e74476f64417065733a20416c6c20476f6473206d696e746564000000006044820152606401610291565b6005816040516103339190610a0c565b9081526040519081900360200190205460ff161561039f5760405162461bcd60e51b815260206004820152602360248201527f6d696e74476f64417065733a205369676e617475726520616c726561647920756044820152621cd95960ea1b6064820152608401610291565b604080516001600160a01b0387166020820152908101859052606081018490526080810183905260a080820152600860c08201526711dbd908135a5b9d60c21b60e08201526104089061010001604051602081830303815290604052805190602001208261071f565b6104545760405162461bcd60e51b815260206004820152601e60248201527f6d696e74476f64417065733a20496e76616c6964207369676e617475726500006044820152606401610291565b60016005826040516104669190610a0c565b908152604051908190036020019020805491151560ff199092169190911790556001805490600061049683610a5d565b909155505060035460405163f81d1fd560e01b8152600481018690526001600160a01b0387811660248301529091169063f81d1fd590604401600060405180830381600087803b1580156104e957600080fd5b505af11580156104fd573d6000803e3d6000fd5b505060025460405163170ef8b560e01b8152600481018890526001600160a01b03909116925063170ef8b59150602401600060405180830381600087803b15801561054757600080fd5b505af115801561055b573d6000803e3d6000fd5b505050507f9c84e2cee7d588b31fd4478891cdb3007b9c6463ce94e9d7fbd6f0745ae290e8858561271061058f9190610a78565b604080516001600160a01b039093168352602083019190915281018590526060810184905260800160405180910390a15050505050565b6105ce610675565b600280546001600160a01b039384166001600160a01b03199182161790915560038054929093169116179055565b610604610675565b6001600160a01b0381166106695760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610291565b610672816106cf565b50565b6000546001600160a01b031633146102ce5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610291565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c81018390526000908190605c016040516020818303038152906040528051906020012090506000806000855160411461078a57600094505050505061084a565b50505060208301516040840151606085015160001a601b8110156107b6576107b3601b82610a90565b90505b60008160ff16601b14806107cd57508160ff16601c145b156108325760408051600081526020810180835287905260ff841691810191909152606081018590526080810184905260019060a0016020604051602081039080840390855afa158015610825573d6000803e3d6000fd5b5050506020604051035190505b6004546001600160a01b039081169116149450505050505b92915050565b80356001600160a01b038116811461086757600080fd5b919050565b6000806040838503121561087f57600080fd5b61088883610850565b915061089660208401610850565b90509250929050565b6000602082840312156108b157600080fd5b6108ba82610850565b9392505050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126108e857600080fd5b813567ffffffffffffffff80821115610903576109036108c1565b604051601f8301601f19908116603f0116810190828211818310171561092b5761092b6108c1565b8160405283815286602085880101111561094457600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080600060a0868803121561097c57600080fd5b61098586610850565b9450602086013593506040860135925060608601359150608086013567ffffffffffffffff8111156109b657600080fd5b6109c2888289016108d7565b9150509295509295909350565b6000602082840312156109e157600080fd5b813567ffffffffffffffff8111156109f857600080fd5b610a04848285016108d7565b949350505050565b6000825160005b81811015610a2d5760208186018101518583015201610a13565b81811115610a3c576000828501525b509190910192915050565b634e487b7160e01b600052601160045260246000fd5b6000600019821415610a7157610a71610a47565b5060010190565b60008219821115610a8b57610a8b610a47565b500190565b600060ff821660ff84168060ff03821115610aad57610aad610a47565b01939250505056fea2646970667358221220ee47a6e1e814d27d51c258724905c2f5c96c3fe48df971bae6fde171dd33d82164736f6c634300080c0033
Verified Source Code Partial Match
Compiler: v0.8.12+commit.f00d7308
EVM: london
Optimization: Yes (200 runs)
GodMinting.sol 143 lines
// SPDX-License-Identifier: GPL-3.0
// solhint-disable-next-line
pragma solidity 0.8.12;
import "./interface/IAssetsInteraction.sol";
import "./reduced_interfaces/BAPApesInterface.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/// @title Bulls and Apes Project - God Minting Contract
/// @author BAP Dev Team
/// @notice Handle the minting of God Apes through the BAP gamification
contract GodMinting is Ownable {
/// @notice Counter of Gods minted
uint256 public godCounter;
/// @notice Apes Contract instance
BAPApesInterface public bapApes;
/// @notice Assets Interactions contract instance
IAssetsInteraction public assetsInteractionContract;
/// @notice Address of the wallet that signs messages
address public secret;
/// @notice Boolean to prevent using the same signature twice
mapping(bytes => bool) public usedSignatures;
/// @notice God Minted event
/// @param element: Element of the God Bull minted, 12 Elements in total (0-11)
/// @param compass: God is Good (0) or Evil (1)
event GodBullMinted(
address user,
uint256 godId,
uint256 element,
uint256 compass
);
/// @notice Deploys the contract and sets the instances addresses
/// @param apesAddress: Address of the Apes Contract
/// @param assetsInteractionAddress: Address of the Teen Bulls contract
constructor(address apesAddress, address assetsInteractionAddress) {
bapApes = BAPApesInterface(apesAddress);
assetsInteractionContract = IAssetsInteraction(assetsInteractionAddress);
}
/// @notice Mint a God Bull
/// @param recipient: Address of the recipient
/// @param apeId: ID of the Ape to use
/// @param element: Element of the God Bull minted, 12 Elements in total (0-11)
/// @param compass: God is Good (0) or Evil (1)
/// @param signature: Signature to confirm above parameters
function mintGodApes(
address recipient,
uint256 apeId,
uint256 element,
uint256 compass,
bytes memory signature
) external {
require(godCounter < 1000, "mintGodApes: All Gods minted");
require(!usedSignatures[signature], "mintGodApes: Signature already used");
require(
_verifyHashSignature(
keccak256(abi.encode(recipient, apeId, element, compass, "God Mint")),
signature
),
"mintGodApes: Invalid signature"
);
usedSignatures[signature] = true;
godCounter++;
assetsInteractionContract.resurrectApe(apeId, recipient); // Send the Ape to the user
bapApes.confirmChange(apeId); // burn-mint Ape to transform it into a God Ape
emit GodBullMinted(recipient, apeId + 10000, element, compass);
}
/// @notice Internal function to set a new signer
/// @param newSigner: Address of the new signer
/// @dev Only the owner can set a new signer
function setSigner(address newSigner) external onlyOwner {
require(newSigner != address(0), "Invalid address");
secret = newSigner;
}
/// @notice Transfer ownership from external contracts owned by this contract
/// @param _contract Address of the external contract
/// @param _newOwner New owner
/// @dev Only contract owner can call this function
function transferOwnershipExternalContract(
address _contract,
address _newOwner
) external onlyOwner {
Ownable(_contract).transferOwnership(_newOwner);
}
/// @notice Set new contracts addresses
/// @param apesAddress: Address of the Apes Contract
/// @param assetsInteractionAddress: Address of the Teen Bulls contract
/// @dev Only contract owner can call this function
function setContractsAddresses(
address apesAddress,
address assetsInteractionAddress
) external onlyOwner {
bapApes = BAPApesInterface(apesAddress);
assetsInteractionContract = IAssetsInteraction(assetsInteractionAddress);
}
/// @notice Internal function to check if a signature is valid
/// @param freshHash: Hash to check
/// @param signature: Signature to check
function _verifyHashSignature(
bytes32 freshHash,
bytes memory signature
) internal view returns (bool) {
bytes32 hash = keccak256(
abi.encodePacked("\x19Ethereum Signed Message:\n32", freshHash)
);
bytes32 r;
bytes32 s;
uint8 v;
if (signature.length != 65) {
return false;
}
assembly {
r := mload(add(signature, 32))
s := mload(add(signature, 64))
v := byte(0, mload(add(signature, 96)))
}
if (v < 27) {
v += 27;
}
address signer = address(0);
if (v == 27 || v == 28) {
// solium-disable-next-line arg-overflow
signer = ecrecover(hash, v, r, s);
}
return secret == signer;
}
}
Context.sol 24 lines
// 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;
}
}
Ownable.sol 83 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (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 Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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);
}
}
IAssetsInteraction.sol 8 lines
// SPDX-License-Identifier: GPL-3.0
// solhint-disable-next-line
pragma solidity 0.8.12;
interface IAssetsInteraction {
function resurrectApe(uint256 tokenId, address recipient) external;
}
BAPApesInterface.sol 14 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;
interface BAPApesInterface {
function ownerOf(uint256) external view returns (address);
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function confirmChange(uint256 tokenId) external;
}
Read Contract
assetsInteractionContract 0x866c6358 → address
bapApes 0x2465f703 → address
godCounter 0x94779ee7 → uint256
owner 0x8da5cb5b → address
secret 0xd1efd30d → address
usedSignatures 0xe949580e → bool
Write Contract 6 functions
These functions modify contract state and require a wallet transaction to execute.
mintGodApes 0x955ec1e1
address recipient
uint256 apeId
uint256 element
uint256 compass
bytes signature
renounceOwnership 0x715018a6
No parameters
setContractsAddresses 0xd8437ab3
address apesAddress
address assetsInteractionAddress
setSigner 0x6c19e783
address newSigner
transferOwnership 0xf2fde38b
address newOwner
transferOwnershipExternalContract 0x24330982
address _contract
address _newOwner
Recent Transactions
This address has 1 on-chain transactions, but only 1.0% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →