html5
看官网语法即可官网链接MarkDown[https://www.w3school.com.cn/html/html5_intro.asp]
solidity靶场
Unstoppable题目源代码
UnstoppableVault中的flashLoan有漏洞
1234不通过depositTokens函数给合约传钱就可以让poolbalance与合约余额不相等,从而使贷款中的这一句无法通过,直接revert,从而使闪电贷无法使用 if (convertToShares(totalSupply) != balanceBefore) revert InvalidBalance();
Naive receiver题目源代码
NaiveReceiverLenderPool.sol中的flashLoan出现了漏洞
12345678910111213141516171819202122232425262728function flashLoan( IERC3156FlashBorrower receiver, address token, uint256 amount, bytes calldata data ) external returns (bool) { if ( ...
capture刷题
MathToken sale1234567891011121314151617181920212223242526272829303132333435363738pragma solidity ^0.4.21;contract TokenSaleChallenge { mapping(address => uint256) public balanceOf; uint256 constant PRICE_PER_TOKEN = 1 ether; function TokenSaleChallenge(address _player) public payable { require(msg.value == 1 ether); } function isComplete() public view returns (bool) { return address(this).balance < 1 ether; } function buy(uint256 ...
MarkDown语法
语法官网链接MarkDown
solidity知识点总结(四)
部署合约通过内联汇编部署合约(懵点)12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061contract TextContract1{ address public owner=msg.sender; function setOwner(address _owner)public{ require(msg.sender==owner,"not owner"); owner=_owner; }}contract TestContract2{ address public owner=msg.sender; uint public value=msg.value; uint public x; uint public y; constructor(uint _x,uint _ ...
solidity基础合约
Ownable12345678910111213141516171819202122// SPDX-License-Identifier: GPL-3.0pragma solidity ^0.8.7;contract Ownable { address public owner; constructor() { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner, "not owner"); _; //函数中其他的代码在 } ////函数中其他的代码在下划线这个位置运行 function setOwner(address _newOwner) external onlyOwner { //切换合约管理员 require(_newOwner != address(0), "invalid addr ...