NoPFP Blog
Home
About
🌐
English 繁體中文
NoPFP Blog
  • Selfdestruct: force another contract to receive your ethers.

    Apr 1, 2022 · 1 min read · receive fallback selfdestruct  ·
    Share on:

    Insert Lead paragraph here. "Smart Contract receive ethers ONLY when contract provide fallback() or receive() function. " Is this statement true or not? [ ] true [ ] false 1pragma solidity ^0.8.0; 23// SPDX-License-Identifier: MIT 4contract MyContract { 5receive() external payable {} 6fallback() external …


    Read More
  • Beware of using tx.origin to verify user

    Mar 30, 2022 · 3 min read · Phishing  ·
    Share on:

    According to Solidity doc, msg.sender (address): sender of the message (current call) tx.origin (address): sender of the transaction (full call chain) tx.origin means the first account that initial transaction. However, the msg.sender is exactly the account that triggers the function. Example Let's take a look at …


    Read More
  • Don't use Blockhash as a source of randomness

    Mar 21, 2022 · 2 min read · randomness  ·
    Share on:

    Random is important in blockchain games. However, there is no true random number on solidity. The best practice is to use Chainlink VRF. This article will show you how to attack a CoinFlip contract. The following code is the CoinFlip contract, which was rewritten from Ethernaut. 1// SPDX-License-Identifier: MIT 2pragma …


    Read More
  • Token URI of ERC1155

    Mar 8, 2022 · 1 min read · solidity  ·
    Share on:

    Token uri can be fixed. Client(e.g. opensea) will replece {id} with tokenId. Take this code as example. 1// SPDX-License-Identifier: MIT 2pragma solidity ^0.8.4; 34import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; 5import "@openzeppelin/contracts/access/Ownable.sol"; 6import …


    Read More
  • How to add Fantom Testnet

    Feb 16, 2022 · 1 min read · solidity  ·
    Share on:

    Add Fantom Testnet on Metamask Visit Chainlist. https://chainlist.org/ connect your metamask search Fantom Add to Metamask Get some $FTM via faucet paste your wallet addres, then click request. https://faucet.fantom.network/ Modify Truffle Setting Open truffle-config.js file, add a new fantom_test into newwork …


    Read More

NoPFP Lab

NoPFP Lab: Not Only Profile Picture Lab
Read More

Featured Posts

  • Selfdestruct: force another contract to receive your ethers.
  • Beware of using tx.origin to verify user
  • Don't use Blockhash as a source of randomness
  • Token URI of ERC1155
  • How to add Fantom Testnet

Recent Posts

  • Selfdestruct: force another contract to receive your ethers.
  • Beware of using tx.origin to verify user
  • Don't use Blockhash as a source of randomness
  • Token URI of ERC1155
  • How to add Fantom Testnet

Categories

SECURITY 3 FANTOM 2

Tags

SOLIDITY 2 FALLBACK 1 INDEX 1 PHISHING 1 RANDOMNESS 1 RECEIVE 1 SELFDESTRUCT 1
NoPFP Blog

Copyright  NOPFP BLOG. All Rights Reserved