Created
September 25, 2024 10:48
-
-
Save gists-immunefi/0b31f575fcb91e4e2275895d4ca9120e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub(crate) fn code_copy(...) { | |
// Charges gas based on the contract's length | |
dependent_gas_charge_without_base( | |
self.cgas, | |
self.ggas, | |
profiler, | |
self.gas_cost, | |
contract_len as u64, // <-- Charged based on this | |
)?; | |
// Copies data with zero-fill | |
copy_from_slice_zero_fill( | |
self.memory, | |
self.owner, | |
contract.as_ref().as_ref(), | |
dst_addr, | |
offset, | |
length, // <-- Amount to copy; excess zero-filled | |
)?; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment