Pyramid is a language to create Ethereum smart contracts
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
basilisk Make types closer to the ones in the Yellow Paper Jan 18, 2018
bin Abstract analyzer can track fixnum allocations; update Ceagle pointer… Mar 14, 2018
ceagle @ 1d78a5e Track largest memory accessed in test performance statistics May 20, 2018
core/lang Use syntax rather than S-expressions for the read layer. Apr 26, 2018
psl memcpy for unaligned byte ranges May 8, 2018
tests memcpy for unaligned byte ranges May 8, 2018
.gitattributes Override Github syntax highlighting for Pyramid files Dec 29, 2017
.gitignore Abstract analyzer can track fixnum allocations; update Ceagle pointer… Mar 14, 2018
.gitmodules Add Ceagle as a submodule Mar 7, 2018
LICENSE Switch to GNU AGPL Jan 20, 2018
Makefile Use syntax rather than S-expressions for the read layer. Apr 26, 2018
README.md Update README.md Apr 5, 2018
abi.rkt Helper for expanding syntax within macros; allow tests to override si… May 2, 2018
abstract-analyzer.rkt memcpy for unaligned byte ranges May 8, 2018
ast.rkt Update Ceagle to use new syntax layer Apr 30, 2018
codegen.rkt Add support for unboxed bytes May 1, 2018
compiler-stages.rkt Use syntax rather than S-expressions for the read layer. Apr 26, 2018
compiler.rkt Use syntax rather than S-expressions for the read layer. Apr 26, 2018
core.rkt Use syntax rather than S-expressions for the read layer. Apr 26, 2018
crypto.rkt Performance improvements by removing a few casts; symbols can be retu… Apr 11, 2018
debugger.rkt memcpy for unaligned byte ranges May 8, 2018
deploy.js Update README; fix simulator error where balance was supposed to tran… Jan 31, 2018
disassembler.rkt Performance improvements by removing a few casts; symbols can be retu… Apr 11, 2018
expander.rkt Add support for unboxed bytes May 1, 2018
globals.rkt Helper for expanding syntax within macros; allow tests to override si… May 2, 2018
io.rkt Use syntax rather than S-expressions for the read layer. Apr 26, 2018
loader.rkt Use syntax rather than S-expressions for the read layer. Apr 26, 2018
macro.rkt Helper for expanding syntax within macros; allow tests to override si… May 2, 2018
main.rkt Use syntax rather than S-expressions for the read layer. Apr 26, 2018
primops.rkt Make unboxed constants part of the AST; rename 0..∞ to Natural; start… Apr 8, 2018
profile.rkt Use syntax rather than S-expressions for the read layer. Apr 26, 2018
pyramid Rename main.rkt to pyramidc.rkt; move ast-unsafe into a submodule of ast Feb 13, 2018
pyramidc.rkt Use syntax rather than S-expressions for the read layer. Apr 26, 2018
reader.rkt Use syntax rather than S-expressions for the read layer. Apr 26, 2018
serializer.rkt Make unboxed constants part of the AST; rename 0..∞ to Natural; start… Apr 8, 2018
simplifier.rkt Helper for expanding syntax within macros; allow tests to override si… May 2, 2018
simulator.rkt Sign extension instruction May 3, 2018
storage.rkt WIP Feb 20, 2018
test.js Update README; fix simulator error where balance was supposed to tran… Jan 31, 2018
test.rkt Track largest memory accessed in test performance statistics May 20, 2018
tests.rkt Use syntax rather than S-expressions for the read layer. Apr 26, 2018
transaction.rkt Make unboxed constants part of the AST; rename 0..∞ to Natural; start… Apr 8, 2018
typed.rkt Fix error where abstract analyzer needed to convert values to boolean… Mar 19, 2018
types.rkt Helper for expanding syntax within macros; allow tests to override si… May 2, 2018
unsafe.rkt WIP conversion to Typed racket Jan 27, 2018
utils.rkt Debug tool for printing boxed bytestrings May 3, 2018
wallet.rkt Fix error where abstract analyzer needed to convert values to boolean… Mar 19, 2018

README.md

Pyramid Scheme

Pyramid is a dialect of the Scheme programming language targeting the Ethereum Virtual Machine(EVM).

Here is an example of a Pyramid program:

(begin
  (define (factorial n)
    (if (= n 1)
        1
        (* (factorial (- n 1)) n)))
  (factorial 5))

Getting Started

Pyramid Scheme is under heavy construction. Join our public Discord channel if you'd like to contribute or use Pyramid to develop Ethereum contracts.

After installing the prerequisites(listed below),

$ ./pyramid -t tests/0001-factorial.pmd 
(Test Passed:  return 120 120 ((s . 14066) (g . 47052) (z . 3591)))

To deploy that program on a test network:

  • Install Ganache CLI
  • Start an EthereumJS test chain: ganache-cli -l 10000000. It will output a list of "Available Accounts".
  • Change the from variable in deploy.js to one of the test accounts.
  • Change the code variable to be the hex string that the Pyramid compiler output
  • Install the Go Ethereum client.
  • Attach to the EthereumJS chain: geth attach http://localhost:8545.
  • Copy the contents of deploy.js into the geth Javascript prompt.

You can see advanced command line options using pyramid --help.

Prerequisites

Editor

I recommend Emacs with racket-mode. You should add Pyramid's .pmd extension to the list of racket-mode file extensions:

(add-to-list 'auto-mode-alist '("\\.pmd\\'" . racket-mode))

License

This project is licensed under the GNU AGPL 3.0 - see the LICENSE.md file for details

Built With

Authors