A compiler for a language to create smart contracts, that is transpiled to Solidity.
The following is a smart contract written in Soliditish, that creates minimal proxies of an NFT contract:
contract NFTFactory {
ERC721 nftContract = 0x24862BDE3581a23552CE4EE712614550d7aE49FC;
event NewCollection(address proxy);
// @notice decorators are used to specify the visibility of the function
@public
function deployNewCollections(uint amount) {
address[amount] newCollections;
uint i;
if (amount > 0) {
for (i = 0; i < amount; i++) {
// out-of-the-box support for creating minimal proxies
address tokenClone = createProxyTo(nftContract);
newCollections[i] = tokenClone;
// out-of-the-box support for logging
log("New Token Clone:", newCollections[i]);
emit NewCollection(newCollections[i]);
}
} else {
log("Amount must be greater than 0");
}
}
}
See more examples in the test/accept folder.
The following dependencies are required to build the project:
To build the project, run the following command from the root directory:
script/build.sh
- Create a file with the program to compile.
- Run the compiler from the root directory of the project, passing the path to the program to compile as a parameter:
script/start.sh <program>
- The compiler will generate a file with the same name as the program, but with the extension
.sol
, in the same directory as the program.
script/test.sh
To add new test cases, create new files containing the program to test, inside the test/accept
or test/reject
folders as appropriate (i.e., whether it should be accepted or rejected by the compiler).