전체 글 (117) 썸네일형 리스트형 IPFS? IPFS IPFS는 "InterPlanetary File System"의 약자로 기존의 HTTP의 문제점을 해결하기 위한 대안으로 분산형 파일 시스템에 데이터를 저장하고 인터넷으로 공유하기 위한 프로토콜이다. 콘텐츠를 중앙화 된 서버에 저장하는 방식과 달리 분산형 노드에 저장한 후 쉽게 접근할 수 있는 경로를 제공해 NFT 이미지를 업로드하는데에 많이 사용되고 있다. 기존 HTTP의 문제점 기존의 HTTP의 문제는 다음과 같다. 불안정 중앙화 비효율 불안정 HTTP 프로토콜은 클라이언트가 서버에 요청을 보내면, 서버에서 응답으로 데이터를 보내주는 구조로 되어있다. 따라서 데이터를 가지고 있는 서버가 전원이 끊기거나 일부러 데이터를 전송하지 않는다면 해당 데이터에 접근 할 수 있는 방법이 없다. 중앙화 오.. UTXO(비트코인) vs Account Balance(이더리움) UTXO UTXO란 Unspent Transaction Outputs의 약자로서, 미사용 트랜잭션 출력 값이다. 이것은 비트코인에서 계정의 잔고를 표현하는 방식인데, 사용되지 않은 트랜잭션 출력 값들의 합이 비트코인의 잔고이다. 예시 A의 비트코인 계정의 잔고가 5개가 있다는 것을 표현하기 위해서 비트코인은 다음과 같이 처리한다. B와 C가 각각 A에게 2비트, 3비트를 전송한다. 비트를 받은 A는 2개, 3개로 나누어진 UTXO 2개를 가지고 있게 된다. 만약 A가 C에게 비트 1개를 전송한다면 1개 이상을 가지고 있는 UTXO 중 한 개가 파기되고 비트 1개가 들어있는 UTXO가 생성된다. 장점 이중 지불 방지 트랜잭션이 발생하면 UTXO는 검증받은 후 TX Pool에 들어간다. 이중 지불이 발생하면.. [Ethernaut] 16. Preservation 소스코드 // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; contract Preservation { // public library contracts address public timeZone1Library; address public timeZone2Library; address public owner; uint storedTime; // Sets the function signature for delegatecall bytes4 constant setTimeSignature = bytes4(keccak256("setTime(uint256)")); constructor(address _timeZone1LibraryAddress, address _tim.. [Ethernaut] 15. Naught Coin 소스코드 // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; contract NaughtCoin is ERC20 { // string public constant name = 'NaughtCoin'; // string public constant symbol = '0x0'; // uint public constant decimals = 18; uint public timeLock = now + 10 * 365 days; uint256 public INITIAL_SUPPLY; address public player; constructor(address _pla.. [Ethernaut] 14. Gatekeeper Two 소스코드 // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; contract GatekeeperTwo { address public entrant; modifier gateOne() { require(msg.sender != tx.origin); _; } modifier gateTwo() { uint x; assembly { x := extcodesize(caller()) } require(x == 0); _; } modifier gateThree(bytes8 _gateKey) { require(uint64(bytes8(keccak256(abi.encodePacked(msg.sender)))) ^ uint64(_gateKey) == uint64(0) - 1.. [Ethernaut] 13. Gatekeeper One 소스코드 // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeMath.sol"; contract GatekeeperOne { using SafeMath for uint256; address public entrant; uint256 i = uint256(uint160(address(tx.origin))); // over 0.8.0 solidity doesn't allow to convert address to uint so this line should be implemented... [Ethernaut] 12. Privacy 소스코드 // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; contract Privacy { bool public locked = true; uint256 public ID = block.timestamp; uint8 private flattening = 10; uint8 private denomination = 255; uint16 private awkwardness = uint16(now); bytes32[3] private data; constructor(bytes32[3] memory _data) public { data = _data; } function unlock(bytes16 _key) public { require(_key == bytes.. [Ethernaut] 11. Elevator 소스코드 // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; interface Building { function isLastFloor(uint) external returns (bool); } contract Elevator { bool public top; uint public floor; function goTo(uint _floor) public { Building building = Building(msg.sender); if (! building.isLastFloor(_floor)) { floor = _floor; top = building.isLastFloor(floor); } } } 목표 빌딩의 최상층에 도달 방법 / SPDX-License-.. 이전 1 ··· 3 4 5 6 7 8 9 ··· 15 다음