solidity: 无法在实现代码中打印log. 只能用event来实现非常原始的输出。 好消息是可以使用 foundry在单元测试中打印log. solidity: for 跟java一样   for(i = 0; i < array.length; i++ ) ... if 跟java一样 class/contract 跟java一样 override 跟...
Blockchain Solidity Hardhat_vs_foundry_foundry完胜
refer to: https://ethereum.stackexchange.com/questions/143171/hardhat-vs-foundry-which-to-use-for-testing https://jamesbachini.com/hardhat-vs-foundry/ 这个文章很精彩  先说下我这些天使用foundry的感受: 1. 速度超级快,运...
Blockchain Security Ai辅助的代码审计
refer to: https://alpha-app.agentlayer.xyz/aegisx 例如:对这个代码: pragma solidity ^0.8.0; import "./ReentrancyGuard.sol"; /** * @title A Very Safe Lender */ interface ERC20Like { function tran...
Blockchain Solidity Ignitiondeploy部署ethcontract地址的产生
refer to: https://hardhat.org/ignition/docs/guides/modifications 首次部署贼简单 不过我失败了。准备使用foundry 第二次部署(修改了contract之后) const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules"); modu...
Blockchain Solidity顶部永远要放一行废代码
refer to: https://stackoverflow.com/questions/65234522/warning-spdx-license-identifier-not-provided-in-source-file // SPDX-License-Identifier: MIT 挺无语的,这个跟java的package有啥区别?没任何区别啊。根本没作用啊。跟<xml ?...
Blockchain区块链编程的本质
构成:blockchain -> contracts -> methods ... contract :  源代码在本地编写,本地编译,部署到远程(链上) 一旦contract部署到了链上,无法更改,只能调用。
Blockchain Solidity 根据某个contract获得bytecode再获得abi
refer to: https://ethereum.stackexchange.com/a/156128/30431 例如,给定某个网络,获得某个contract的abi: 1. 先获得对应contract的bytecode: curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","meth...
Blockchain Solidity Nested_mapping
refer to: kimi, https://ethereum.stackexchange.com/questions/42272/is-it-possible-to-assign-a-map-as-a-mappings-value 三重mapping的例子: // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.13; c...
Blockchain 区块链攻击事件汇总
refer to: 2022: https://www.panewslab.com/zh/articledetails/l9hj2ngug39u.html 2023: https://www.fx168news.com/article/433280
Blockchain Solidity Yul 使用remix来调试assembly使用log1来触发event
refer to: https://medium.com/@kulman.david/how-to-use-remix-debugger-to-learn-solidity-assembly-5a745a22bb07 1. copy代码到remix 2. compile, deploy 3. 调用 调用后,可以看到debug信息 步骤,对应的代码,消耗的gas: 具体使用: // S...
Blockchain 不同网络的对于智能合约contract的编程语言
eth:  solidity trx:  solidity, javascript eos: c++ solana: rust ,c avalanche: solidity, bnb: bsc:  solidity polygon: solidity
Blockchain Solidity Evmplayground
refer to: https://www.evm.codes/playground?unit=Wei&codeType=Bytecode&code=%27%7E3560203501%7E526020%7Ef3%27%7E6000%01%7E_&fork=cancun 在这里可以对EVM(汇编)进行调试
Blockchain Solidity Huff 2安装和初见
refer to:https://docs.huff.sh/get-started/installing/#installing-huff 安装:(奇了怪了,我一直无法安装),后来在tokyo服务器上安装的 curl -L get.huff.sh | bash 声明一个ABI 声明一个macro #define function addTwo(uint256, uint256) vi...
Blockchain Solidity Huff 1理解evm
refer to: https://docs.huff.sh/tutorial/evm-basics/#technical Stack EVM的stack machine是1024个层次,每个层次是32bytes. 后入先出( last in, first out ) Memory: 可扩展(可改变) 消耗gas  calldata   跟memory...
Linux Sudo的同时保持http_proxy Https_proxy
refer to: https://gist.github.com/hindol/4483374 1.  使用命令:sudo visudo   修改文件: /etc/sudoers 2. 保证添加这一句: Defaults env_keep+="http_proxy ftp_proxy all_proxy https_proxy no_proxy" 就可以了。 3. 验...
Ai Chatgpt Gptshunters 大集合
https://www.gptshunter.com/
Ai相关概念
以下都是copy来的。。。给自己一个思路. https://www.bilibili.com/video/BV1oF411F7hG?p=4&spm_id_from=pageDriver&vd_source=760370308ce01ce4b34ea757917ac641 POE.  以下COPY自POE. 人工智能(Artificial Intelligenc...
Ai Python 视觉识别opencv Computer Vision Library 3模式匹配match Template 增加缩放功能
refer to: https://pyimagesearch.com/2015/01/26/multi-scale-template-matching-using-python-opencv/ 结论: 最好还是用手动截取的template 缩放截取的,匹配度比较低。 关键代码: # 缩放模板图像 scale_percent = 60 # 缩放比例为60% width = int(te...
Python 运行单元测试unit Test Testcase
https://docs.python.org/3/library/unittest.html 非常简单: class: class VisionTool: def __init__(self): pass def get_current_player_cards(self, source_image_name): pass 对应的测试文件...
Vmware Ubuntu22 Install Vmware Tools
refer to: https://linuxconfig.org/install-vmware-tools-on-ubuntu-22-04-jammy-jellyfish-linux 1. # UBUNTU 22.04 SERVER:$ sudo apt install open-vm-tools # UBUNTU 22.04 DESKTOP:$ sudo apt install ope...