Skip to content

Instantly share code, notes, and snippets.

@aodhgan
Created October 31, 2020 04:51
Show Gist options
  • Save aodhgan/a7ef3993fd526c983efcd7f577909dcf to your computer and use it in GitHub Desktop.
Save aodhgan/a7ef3993fd526c983efcd7f577909dcf to your computer and use it in GitHub Desktop.
function _destroyChildren(uint256 value) internal {
assembly {
let i := sload(totalBurned_slot)
let end := add(i, value)
sstore(totalBurned_slot, end)
let data := mload(0x40)
mstore(data, 0xff0000000000004946c0e9F43F4Dee607b0eF1fA1c0000000000000000000000)
mstore(add(data, 53), 0x3c1644c68e5d6cb380c36d1bf847fdbc0c7ac28030025a2fc5e63cce23c16348)
let ptr := add(data, 21)
for { } lt(i, end) { i := add(i, 1) } {
mstore(ptr, i)
pop(call(gas(), keccak256(data, 85), 0, 0, 0, 0, 0))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment