Solidity Compiler for Solana and Polkadot
This release improves the Solana developer experience, since now required accounts can be specified using annotations. For Polkadot, compatibility with Ethereum Solidity has been increased further, it is now possible to write EIP-1967 compatible proxy contracts. There are many fixes all over the code base.
contract Foo {
@account(oneAccount)
@signer(mySigner)
@mutableAccount(otherAccount)
@mutableSigner(otherSigner)
function bar() external returns (uint64) {}
}
forge-fmt
crate. chioni16
Panic
errors can now be caught in try-catch statements
xermicus
address.code
builtin
xermicus
return a = b
. xermicus
storage
location. xermicus
The language server is much improved, and many fixes all over.
./foo
or ../foo
.
seanyoung
lamports
and data
fields of tx.accounts
can be
modified again. LucasSte
-
now checks for overflow at runtime, and other
math overflow fixes. seanyoung
assert()
and require()
is now implemented as a
transction revert, rather than a trap. The error data is returned, and
encoded the same as on Ethereum. Error data is now passed to the calling
contract, all the way up the call stack.
xermicus
is_contract
runtime API is available as a builtin for Substrate. xermicus
wasm-opt
optimizer now optimizes the Wasm bytecode on the Substrate target. xermicus
@payer(my_account)
can be accessed with the
syntax tx.accounts.my_account
. LucasSte
delegatecall()
builtin has been added for Substrate. xermicus
get_contents_of_file_no
for Solang parser. BenTheKush
set_code_hash()
builtin has been aded for Substrate. xermicus
require(i < 2**255)
. seanyoung
.wrap()
and .unwrap()
user defined type methods in constants. xermicus
@inheritdoc
now works with bases of bases. seanyoung
bytes32
. seanyoung
call
and deploy
dispatches on Substrate. xermicus
1.68
.@payer
annotation declares an account in a constructor. LucasSte
.call()
functions in functions declared as view. seanyoung
contract MyContract {
@payer(acc) // Declares account acc
@space(2+3) // Only literals or constant expressions allowed
@seed(myseed) // NOT ALLOWED
constructor(bytes myseed) {}
}
contract MyContract {
@payer(acc) // Declares account acc
@space(2+3) // Only literals or constant expressions allowed
constructor(@seed bytes myseed) {}
// When an annotations refers to a parameter, the former must appear right before the latter.
}
The parser and semantic analysis stage of Solang have gone through a security audit. All security issues have been fixed.
--release
option, which disables printing of errors. salaheldinsoliman
cargo test
. seanyoung
storage
reference, then not returning a value explicitly is an error, since
the reference must refer to an existing storage variable. seanyoung
sol
and lamports
are now supported, e.g. 10 sol
and 100 lamports
.
seanyoung
SystemAccount
, ClockAccount
, or other standard builtin
accounts, then this is automatically added to the IDL. LucasSte
bytesN
xermicus
unchecked { .. }
block.
The --math-overflow
command line option has been removed. seanyoung
instantiation_nonce
runtime API. xermicus
1.65.0
@solana/solidity.js
Typescript library is no longer compatible with Solidity.bytesN
type, the hex literal may use leading zeros to match the size
with the according bytesN
, which aligns solang with solc
. xermicus
@selector([1, 2, 3, 4])
syntax, and the old syntax selector=hex"12345678"
has been removed.msg.sender
was not implemented correctly on Solana, and
has now been removed.
seanyoung
We are happy to release solang v0.2.0
codenamed Berlin
today. Aside from containing many small fixes and improvements, this release marks a milestone towards maturing our Substrate compilation target: Any regressions building up since ink!
v3.0 are fixed, most notably the metadata format (shoutout and many thanks to external contributor extraymond) and event topics. Furthermore, we are leaving ink!
version 3 behind us, in favor of introducing compatibility with the recent ink!
4 beta release and the latest substrate contract node v0.22.1
.
solang idl
which can be used for generating
a Solidity interface file from an Anchor IDL file. This can be used for calling
Anchor Contracts on Solana. seanyoung
Hash
type from ink!
is the first ink!
specific type made available for Solidity
contracts.
xermicus
--log-api-return-codes
CLI flag, which changes the
emitted code to print return codes for seal
API calls into the debug buffer.
xermicus
v0.22.1
.
xermicus
random
builtin.
xermicus
ink!
version 4 (beta).
xermicus
ink!
crates, which fixes all
remaining metadata regressions.
extraymond and xermicus
ink!
.
xermicus
ink!
.
xermicus
compile
, doc
, shell-completion
and the language-server
, which makes
for a cleaner CLI.
seanyoung
ink!
.
xermicus
.push()
and .pop()
on
dynamic arrays in memory.
seanyoung
selector=hex"abcd0123"
syntax.
seanyoung
solang shell-completion
subcommand.
xermicus
create_program_address()
and try_find_program_address()
system call on Solana
seanyoung
print()
builtin is now supported and will write to the debug
buffer. Additionally, error messages from the require
statements will now be
written to the debug buffer as well. The Substrate contracts pallet prints the
contents of the debug buffer to the console for RPC ("dry-run") calls in case
the runtime::contracts=debug
log level is configured.
xermicus
/** ... */
are now permitted anywhere.
seanyoung
Signed-off-by: Sean Young [email protected]
git submodule update --init --recursive
to fetch the test files, and
then run the test with cargo test --workspace
.