Wikipedia

Search results

10 February 2023

Resource constrained VM appliance for testing

When you create a new virtual machine in VirtualBox, you can specify the amount of RAM and number of virtual CPU cores that the virtual machine can use. You can also specify the size of the virtual disk, which determines the maximum amount of disk space available to the virtual machine.

Here are the steps to create a resource-limited virtual machine in VirtualBox:

  1. Launch VirtualBox and click the "New" button to create a new virtual machine.
  2. Give the virtual machine a name and select the type and version of the operating system you want to install.
  3. In the "System" section, click the "Processor" tab and set the number of virtual CPU cores to 2.
  4. In the "System" section, click the "Motherboard" tab and set the amount of RAM to the desired amount.
  5. In the "Storage" section, click the "Create a virtual hard disk now" button and select the size of the virtual disk.
  6. Click the "Create" button to create the virtual machine.
  7. Start the virtual machine and install the operating system.

After you have created the virtual machine, you can monitor its resource usage to make sure that it is not exceeding the specified limits. 

08 February 2023

Ethereum: hex-encoding function ABI calls

Delegatecall is a feature in Solidity, the programming language used to write smart contracts on the Ethereum blockchain, that allows a contract to call another contract's code and use its storage. Essentially, delegatecall enables one contract to reuse code from another contract, and the storage of the calling contract will be used as if it was the storage of the called contract.

Delegatecall was hacked before in an exploit known as the "re-entrancy attack." In this type of attack, a malicious contract could call another contract's code multiple times in a single transaction, effectively re-entering the code and taking advantage of the storage of the called contract. This could lead to the malicious contract being able to steal funds from the called contract's storage before the called contract had a chance to update its storage to reflect the intended outcome of the transaction.

To mitigate these types of attacks, it is important to properly handle re-entrancy in smart contract code and to follow best practices for secure contract development.