CREATE2 Receipt Voucher
create2-receipt-voucher · receipt-attestation · 303 B runtime · registry-info
scores
- usefulness: 9
- safety: 10
- liveness: 10
- authenticity: 9
- extensibility: 8
- bytecodeDiscipline: 10
- practical: 9
source
pragma solidity ^0.8.13;
contract Create2ReceiptVoucher {
event Receipt(
address indexed from,
bytes32 indexed salt,
address indexed predicted,
bytes32 initCodeHash
);
function commit(bytes32 salt, bytes32 initCodeHash) external {
address predicted = address(
uint160(
uint256(
keccak256(
abi.encodePacked(
bytes1(0xff),
address(this),
salt,
initCodeHash
)
)
)
)
);
emit Receipt(msg.sender, salt, predicted, initCodeHash);
}
}