Open q871795224 opened 3 years ago
Hi @q871795224 ,
SOLL has not yet supported multiple yul files. I am afraid that you may need to compose it into a single file and then send to SOLL.
For example, here is a workaround for you.
contract Abt {
mapping (address => uint256) public etherBalance;
uint256 feeETH = 0;
uint256 totalEthFee = 0;
constructor() {
feeETH = 1500000000000000;
}
function deposit() payable public {
totalEthFee = sub(totalEthFee, feeETH);
//etherBalance[msg.sender] = etherBalance[msg.sender].add(msg.value);
}
function balanceOfETH(address user) public returns (uint256) {
return etherBalance[user];
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
require(b <= a);
c = a - b;
}
}
And we also found a lack of yul opcode invalid
. Because the output yul from the above sol contains invalid()
, you may get this error /tmp/sol/Abt.yul:277:17: error: Use of undeclared identifier 'invalid'
. I created a new issue to track this error, see #47
It helps a lot, thanks you!
After I use solidity to yul function of solc, sometimes solc will compile the contract file into multiple yul files. So how do I use soll to compile it into a wasm file? For example:
After "solc -o ./ --ir ./Abt.sol", multiple files will appear.
So how to compile multiple yul files?