add param to SentBomb event

master
lza_menace 1 year ago
parent f80234d8ea
commit 779788c006

@ -71,7 +71,8 @@ contract Main is Owned {
/// @param from Sender of the bombs
/// @param tokenId Unaboomer token which was targeted
/// @param hit Whether or not the bomb killed the token or not (was a dud / already killed)
event SentBomb(address indexed from, uint256 indexed tokenId, bool hit);
/// @param owned Whether or not the sender was the owner of the BOOMR token
event SentBomb(address indexed from, uint256 indexed tokenId, bool hit, bool owned);
constructor() Owned(msg.sender) {}
@ -201,7 +202,8 @@ contract Main is Owned {
uint256 randomBoomer = uint256(keccak256(abi.encodePacked(i, block.timestamp, msg.sender))) % supply;
bool dud = unaboomer.tokenDead(randomBoomer);
unaboomer.die(randomBoomer);
emit SentBomb(msg.sender, randomBoomer, !dud);
bool senderOwned = msg.sender == unaboomer.ownerOf(randomBoomer);
emit SentBomb(msg.sender, randomBoomer, !dud, senderOwned);
}
mailbomb.explode(msg.sender, _amount);
}

@ -0,0 +1,5 @@
#!/bin/bash
export $(cat .env)
forge script script/Unaboomer.s.sol:DeployProject --private-key=$LOCAL_KEY --rpc-url http://localhost:8545 --broadcast
cast send --private-key=$LOCAL_KEY --rpc-url=$LOCAL_RPC --value "10 ether" 0x653D2d1D10c79017b2eA5F5a6F02D9Ab6e725395
Loading…
Cancel
Save