The Solidity Contract-Oriented Programming Language - By chatting here you agree to the https://github.com/ethereum/solidity/blob/develop/CODE_OF_CONDUCT.md
I'm trying to install Solidity compiler to work with Z3 (Mac). I tried 2 things:
1) I installed from source with Z3 present brew install solidity
(from what I understand in the documentation the build should install with Z3 support unless explicitly disabled with a flag)
2) I installed z3 separately brew install z3
Then I run solc simple.sol --model-checker-engine bmc --model-checker-solvers z3
, however, solc is reporting the following:
Warning: BMC analysis was not possible since no SMT solver was found and enabled.
Any idea how to get this to work?
using
statement
It's hard to tell what's really happening without more details. Do you have cmake output from the build?
You could submit an issue with more details in the bug tracker and we'll investigate.
As a workaround, you could try our own formula that has a dependency on z3: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/solidity.rb
Or try a static binary from solc-bin - these have Z3 statically compiled-in: https://github.com/ethereum/solc-bin/tree/gh-pages/macosx-amd64
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract Test1{
uint private a1 = 11;
function get() public view returns (uint){
return a1;
}
function set(uint a) public{
a1=a;
}
function set1() public {
a1=22;
}
fallback() external {
a1=33;
}
}
contract Test2{
function call_1(address contractAddress) public{
(bool success,bytes memory a) =contractAddress.call(abi.encodeWithSignature("set(uint)",44));
require(success);
}
function call_2(address contractAddr) public {
(bool success,) = contractAddr.call(abi.encodeWithSignature("set1()")); require(success);
require(success);
}
}
function "call_1" does not work
const DOMAIN_TYPE = [
{
type: 'string',
name: 'name'
},
{
type: 'string',
name: 'version'
},
{
type: 'uint256',
name: 'chainId'
},
{
type: 'address',
name: 'verifyingContract'
}
];
const domainData = {
name: 'Market721',
version: '1',
chainId: '1337',
verifyingContract: '0x296564F6260b95f99F93fB347d456b7FC825771b'
};
const OrderTypes = {
AssetType: [
{ name: 'assetClass', type: 'bytes4' },
{ name: 'data', type: 'bytes' }
],
Asset: [
{ name: 'assetType', type: 'AssetType' },
{ name: 'value', type: 'uint256' }
],
Order: [
{ name: 'maker', type: 'address' },
{ name: 'makeAsset', type: 'Asset' },
{ name: 'taker', type: 'address' },
{ name: 'takeAsset', type: 'Asset' }
]
};
const createTypeData = (domain, primaryType, message, types) => {
return {
types: { EIP712Domain: DOMAIN_TYPE, ...types },
domain,
primaryType,
message
};
};
const leftUH = {
maker: "0xfa6954192c3087f9143f5401f7804b405ac84ca5",
makeAsset: {
assetType: {
assetClass: id('ERC20'),
data: web3.eth.abi.encodeParameter('address', '0xfa6954192c3087f9143f5401f7804b405ac84ca5')
},
value: BigNumber("100000000")
},
taker: "0x3bed4334ce380cfe41363c7e875a9fc1769578b1",
takeAsset: {
assetType: {
assetClass: id('ERC721'),
data: web3.eth.abi.encodeParameter({ root: { contract: "address", tokenId: "uint256" }}, { contract: '0xfa6954192c3087f9143f5401f7804b405ac84ca5', tokenId: 1 })
},
value: "1"
}
};
const leftMsgParams = createTypeData(domainData, 'Order', leftUH, OrderTypes)
const leftSig = sigUtil.signTypedData_v4(Buffer.from(leftAcc, 'hex'), { data: leftMsgParams });
Hi I'm actually doing an online course and I'm developping on nextjs but I have this poblem on my web3.js code :Server Error
ReferenceError: window is not defined
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Source
eth/web3.js (3:0) @ eval
1 | import Web3 from "web3";
2 |
3 | window.ethereum.request({ method: "eth_requestAccounts" });
4 |
5 | const web3 = new Web3(window.ethereum);
6 |
Hi @cameel:matrix.org I read in the docs:
block.basefee (uint): current block’s base fee (EIP-3198 and EIP-1559)
https://docs.soliditylang.org/en/v0.8.9/cheatsheet.html?highlight=block.basefee
It's a bit ambiguous as to whether this is the base fee of the previous block or the current block that this transaction will be included in.
Is it the basefee of the block that the transaction is included in?
Also I wondered what's the best way to get the value for the transactions priorityFee?
Is it: tx.gasprice - block.basefee
?