flintlang / flint Goto Github PK
View Code? Open in Web Editor NEWThe Flint Programming Language for Smart Contracts
License: MIT License
The Flint Programming Language for Smart Contracts
License: MIT License
We need to check the validity of a function call in terms of the capabilities which are associated with it, and the context's (enclosing function) capability-level.
For
Foo :: (any) {
func foo() {
bar()
}
}
Foo :: (owner) {
func bar() {}
}
The compiler should throw an error for line 3.
A function should be able to be called if the caller has any of the capabilities.
Currently, a return statement in an if
branch is emitted by a ret := expr
in IULIA, but the function doesn't actually return.
i.e. when the caller is the same contract, and the call wasn't a try
When a contract behavior declaration is created, we need to check that the caller capability group used is valid, i.e., that all the capabilities are variables declared in the contract's declaration, and have a sensible type (Address
).
We need to check that each contract behavior declaration has an accompanying contract declaration.
Currently, this compiles, but shouldn't:
Foo :: (any) {}
The contract Foo
is not declared.
contract X {
let name: String = "Contract X" // warn: name was never used
}
if a > 2 {
if a > 1 {
return 0
}
}
return 1
currently returns 1
for input a = 3 but should return 0.
Implement a simple type checker for Flint
Contracts must be able to have a special initializer function, whose body must be run on contract creation.
At the IULIA-level, the relevant code must be emitted in the contract initializer, and not the fallback function.
Investigate the usefulness of mutation capabilities which limit what part of the state functions can mutate.
contract Foo {
var bar: Int
}
Foo :: (any) {
mutating(bar) func baz() {
qux() // expected-error {{qux() cannot be called using mutation capability bar}}
}
mutating func qux() {
}
}
At the moment, for
contract Test {
var a: Int
}
Test :: (any) {
mutating func foo(a: Int) {
self.a = a
}
}
the compiler emits:
function foo(_a) {
sstore(_a, _a)
}
Which is incorrect.
Such as +=
, -=
, etc.
Currently, any error/warning in any stage of the compiler passes results in a Swift exception being thrown.
We should give better diagnostics to the user, giving the source location and the reason of the error.
We need to add support for defining local variables in a function body.
This involves figuring out what IULIA code to emit and where to store local variables.
i.e. store four 64-bit integers in a single storage slot
Solidity documentation:
https://solidity.readthedocs.io/en/develop/miscellaneous.html#layout-of-state-variables-in-storage
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.