Giter Site home page Giter Site logo

sambacha / zen-foundry-template Goto Github PK

View Code? Open in Web Editor NEW
28.0 3.0 2.0 113 KB

zen minimal foundry template

Shell 23.08% JavaScript 1.15% Makefile 10.02% Solidity 65.75%
foundry forge solidity template boilerplate minimal zen dapp dapptools ethereum

zen-foundry-template's Introduction

zen.foundry-template

a minimalist foundry boilerplate

forge init --template https://github.com/sambacha/zen-foundry-template

template.script

#!/bin/sh
GIT_AUTHOR_DATE="Sun, 01 Jan 2023 00:00:00 +0000" GIT_COMMITTER_DATE="Sun, 01 Jan 2023 00:00:00 +0000" git commit --allow-empty --allow-empty-message -m ''
wget https://raw.githubusercontent.com/sambacha/zen-foundry-template/master/.gitignore
wget https://raw.githubusercontent.com/sambacha/zen-foundry-template/master/.gitattributes
wget https://raw.githubusercontent.com/sambacha/zen-foundry-template/master/.editorconfig
wget https://raw.githubusercontent.com/sambacha/zen-foundry-template/master/justfile
wget https://raw.githubusercontent.com/sambacha/zen-foundry-template/master/foundry.toml 
mkdir -p src
mkdir -p test
mkdir -p .github/workflows
forge config > foundry.toml
touch .dapprc
touch .env
git commit -n -m "feat(release): inital commit"

The base fuzzing account

0xAaaaAaAAaaaAAaAAaAaaaaAAAAAaAaaaAaAaaAA0

An account with 0 ETH

0xAaAAAaaAAAAAAaaAAAaaaaAaAaAAAAaAAaAaAaA1

An account with a lot of ETH

0xAaAaaAAAaAaaAaAaAaaAAaAaAAAAAaAAAaaAaAa2

The creator account

0xafFEaFFEAFfeAfFEAffeaFfEAfFEaffeafFeAFfE

Example Contract Documentation

Contract

Options --

Classes --

abstractLibrary

Inheritance --

usingFor --

Vars --

Methods

๐Ÿ”str_concat() _a _b
๐Ÿ”str_concat() _a _b _c
๐Ÿ”str_concat() _a _b _c _d
๐Ÿ”str_concat() _a _b _c _d _e
๐Ÿ”str_concat() _a _b _c _d _e _f
๐Ÿ”str_concat() _a _b _c _d _e _f _g
๐Ÿ”str_concat() _a _b _c _d _e _f _g _h

	string memory _a,
    string memory _b,
    string memory _c,
    string memory _d,
    string memory _e,
    string memory _f,
    string memory _g,
    string memory _h

๐Ÿ”int_to_string()
๐Ÿ”to_ascii_string()
๐Ÿ”char()

git-init script

#!/bin/bash
git init --shared=false
function writeGitIgnore() {
  cat << EOF >.gitignore
# -*- mode: gitignore; -*-
/out
cache/
artifacts/
logs
*.log
!/broadcast
/broadcast/*
/broadcast/*/31337/

## CVE-2021-21300 style exploits
.\#*

## General ##
*~
\#*\#
/**/build
.DS_Store
node_modules
tmp/
_dev/
coverage/
/dist
/build

## Binary ##
*.zip
*.tar
*.tar.gz
*.tgz

## IDE ##
.secret
.idea/*

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
EOF
}
function writeEditorConfig() {
  cat << EOF >.editorconfig
# 
root = true

# All files
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

# Solidity
# https://github.com/sambacha/prettier-config-solidity
[*.sol]
indent_size = 4
indent_style = space

# q 
# kdb+ 
[*.q]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

# Markdown
[*.{md,adoc,asciidoc}]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = false

# Match nix files, set indent to spaces with width of two
[*.nix]
indent_style = space
indent_size = 2

# JavaScript, JSON, JSX, JavaScript Modules, TypeScript
# https://github.com/feross/standard
# https://prettier.io
[*.{cjs,js,json,jsx,mjs,ts,tsx,mts,cts}]
indent_size = 2
indent_style = space

# TOML
# https://github.com/toml-lang/toml/tree/master/examples
[*.toml]
indent_size = 2
indent_style = space

# YAML
# http://yaml.org/spec/1.2/2009-07-21/spec.html#id2576668
[*.{yaml,yml}]
indent_size = 2
indent_style = space

# Shell
# https://google.github.io/styleguide/shell.xml#Indentation
[*.{bash,sh,zsh}]
indent_size = 2
indent_style = space

# confg + cfg
[*.{conf,cfg}]
charset                     = UTF-8
end_of_line                 = LF
indent_size                 = 4
indent_style                = tab
insert_final_newline        = true
tab_width                   = 4
trim_trailing_whitespace    = true

# Match diffs, avoid to trim trailing whitespace
[*.{diff,patch}]
trim_trailing_whitespace = false

# Ignore fixtures and vendored files
[{dist,artifacts,vendor,test/fixtures,tests_config,__snapshot__,}/**]
charset = unset
end_of_line = unset
indent_size = unset
indent_style = unset
insert_final_newline = unset
trim_trailing_spaces = unset
EOF
}
writeGitIgnore;
writeEditorConfig;
GIT_AUTHOR_DATE="Fri, 01 Jan 2021 00:00:00 +0000" GIT_COMMITTER_DATE="Fri, 01 Jan 2021 00:00:00 +0000" git commit --allow-empty --allow-empty-message -m ''
echo "configured, successful"
exit 0

zen-foundry-template's People

Contributors

sambacha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

zen-foundry-template's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.