Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gists-immunefi/0b31f575fcb91e4e2275895d4ca9120e to your computer and use it in GitHub Desktop.
Save gists-immunefi/0b31f575fcb91e4e2275895d4ca9120e to your computer and use it in GitHub Desktop.
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