Web3

// SPDX-License-Identifier: MITpragma solidity ^0.8.0;contract Privacy { bool public locked = true; uint256 public ID = block.timestamp; uint8 private flattening = 10; uint8 private denomination = 255; uint16 private awkwardness = uint16(block.timestamp); bytes32[3] private data; constructor(bytes32[3] memory _data) { data = _data; } function unlock(bytes16 _key..
// SPDX-License-Identifier: MITpragma solidity ^0.8.0;interface Building { function isLastFloor(uint256) external returns (bool);}contract Elevator { bool public top; uint256 public floor; function goTo(uint256 _floor) public { Building building = Building(msg.sender); if (!building.isLastFloor(_floor)) { floor = _floor; top = building.isLastFloor(..
아 Foundry 코드짜는거가 익숙치가 않아서 너무 시간을 많이 잡아 먹었다.// SPDX-License-Identifier: MITpragma solidity ^0.6.12;import "openzeppelin-contracts-06/math/SafeMath.sol";contract Reentrance { using SafeMath for uint256; mapping(address => uint256) public balances; function donate(address _to) public payable { balances[_to] = balances[_to].add(msg.value); } function balanceOf(address _who) pub..
문제 설명이 영어로되어있기도 하고 뭐라는지 모르겠어서 푸는데 애먹었다;; 대충 설명하자면 king을 빼앗는게 목표인데 instance 제출할때 다시 문제에서 king을 탈취할려고 시도할 것이다.이거를 방해하기 까지 하면 성공이다.// SPDX-License-Identifier: MITpragma solidity ^0.8.0;contract King { address king; uint256 public prize; address public owner; constructor() payable { owner = msg.sender; king = msg.sender; prize = msg.value; } receive() external ..
// SPDX-License-Identifier: MITpragma solidity ^0.8.0;contract Vault { bool public locked; bytes32 private password; constructor(bytes32 _password) { locked = true; password = _password; } function unlock(bytes32 _password) public { if (password == _password) { locked = false; } }}password를 알아내면 되는 문제이다.password가 private이여서 일반적인 접근은 안된다.다만..
프레딕
'Web3' 카테고리의 글 목록 (3 Page)