Skip to content

Instantly share code, notes, and snippets.

@nakajo2011
Created June 12, 2024 05:39
Show Gist options
  • Save nakajo2011/0e4773a5e0d7466021fa5f9eeaa91081 to your computer and use it in GitHub Desktop.
Save nakajo2011/0e4773a5e0d7466021fa5f9eeaa91081 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.26+commit.8a97fa7a.js&optimize=false&runs=200&gist=
pragma solidity >=0.8 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
* @custom:dev-run-script ./scripts/deploy_with_ethers.ts
*/
contract BitShiftTest {
uint256 number;
function storeWithShift(uint256 num, uint256 shift) public {
number = num << shift;
}
function retrieve() public view returns (uint256){
return number;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment