npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@acdi/efem-crowdfunding

v1.0.0-alfa.9

Published

Crowdfunding Smart Contract de El Futuro está en el Monte

Downloads

25

Readme

Crowdfunding Smart Contract

Smart contract de Crowdfunding.

Se utiliza Buidler como herramienta de ejecución de las tareas de compilación, testing y despliegue del smart contract.

En la sección Architectural Decision Log se encuentran los registros de decisiones de arquitectura que han sido tomadas.

Requisitos sobre sistema operativo

Windows

Instalar Python.

Instalación de dependencias

Primero deben instalarse las dependencias del proyecto con el siguiente comando:

npm install

Compilación

Para compilar el smart contract, debe ejecutarse el siguiente comando.

npm run compile

Se requiere mantener reducido el bytecode generado por el smart contract para no superar la restricción EIP 170. El siguiente comando mide la cantidad de bytes generados para cada contrato compilado.

grep \"bytecode\" artifacts/* | awk '{print $1 " " length($3)/2}'

Testing

Para ejecutar los tests del smart contract, debe ejecutarse el siguiente comando.

npm run test

Los test se ejecutan por defecto sobre la blockchain buidlerevm.

Publicar en NPM

Para que el módulo quede públicamente accecible y pueda utilizarse por los demás módulos de la aplicación, es necesario publicar de la siguiente manera:

npm login
npm publish --access public

El módulo se publica con el scope de la organización @acdi.

Despliegue

Para desplegar el smart contract sobre la blockchain de RSK, debe ejecutarse el siguiente comando con el nodo RSK accesible desde http://localhost:4444.

npm run deploy:rsk

Junto con el smart contract de Crowdfunding se despliegan los smart contract de Aragon y librerías por lo que este proceso puede demandar algunos minutos.

Las direcciones que aparecen en el log deben utilizarse para configurar la aplicación de Crowdfunding.

Algunas veces el script anterior falla al no encontrar algunos smart contracts de Aragon desplegados, por ejemplo, es posible encontrarse con el siguiente error: Error: BDLR700: Artifact for contract "Kernel" not found. En este caso ejecutamos npm start. Esto último a menudo muestra algún error, pero lo que nos interesa es que despliegue los smart contracts faltantes. Una vez hecho esto volver a ejecutar npm run deploy:rsk

Principios de desarrollo

Para el desarrollo del smart contract se deben seguir los siguientes principios:

  • Seguir la guía de estilos de desarrollo de Solidity.
  • El orden los metodos debe ser: external, public, internal y private; Deben seguir un orden de relevancia.
  • Siempre que sea posible, el tratamiento sobre las entidades debe delegarse en las librerías para mantener el bytecode del smart contract reducido.
  • Sebe realizarse testing automático de las funcionalidades expuestas al exterior.

Running your app

To run the app in a browser with frontend and contract hot-reloading, simply run npm start.

  1. Add code quality tools, like JS and contract linting. You may also want to check existing buidler plugins.
  2. Develop your AragonApp contract
  3. Develop your frontend
  4. Publish!

What's in this boilerplate?

npm Scripts

  • postinstall: Runs after installing dependencies.
  • build-app: Installs front end project (app/) dependencies.
  • start Runs your app inside a DAO.
  • compile: Compiles the smart contracts.
  • test: Runs tests for the contracts.
  • publish:major: Releases a major version to aragonPM.
  • publish:minor: Releases a minor version to aragonPM.
  • publish:patch: Releases a patch version to aragonPM.

Hooks

These hooks are called by the Aragon Buidler plugin during the start task's lifecycle. Use them to perform custom tasks at certain entry points of the development build process, like deploying a token before a proxy is initialized, etc.

Link them to the main buidler configuration file (buidler.config.js) in the aragon.hooks property.

All hooks receive two parameters: 1) A params object that may contain other objects that pertain to the particular hook. 2) A "bre" or BuidlerRuntimeEnvironment object that contains environment objects like web3, Truffle artifacts, etc.

// Called before a dao is deployed.
preDao: async ({ log }, { web3, artifacts }) => {},

// Called after a dao is deployed.
postDao: async ({ dao, _experimentalAppInstaller, log }, { web3, artifacts }) => {},

// Called after the app's proxy is created, but before it's initialized.
preInit: async ({ proxy, _experimentalAppInstaller, log  }, { web3, artifacts }) => {},

// Called after the app's proxy is initialized.
postInit: async ({ proxy, _experimentalAppInstaller, log  }, { web3, artifacts }) => {},

// Called when the start task needs to know the app proxy's init parameters.
// Must return an array with the proxy's init parameters.
getInitParams: async ({ log }, { web3, artifacts }) => {
  return []
}

If you want an example of how to use these hooks, please see the plugin's own tests for an example project.

Structure

This boilerplate has the following structure:

root
├── app
├ ├── src
├ └── package.json
├── contracts
├ └── CounterApp.sol
├── test
├── arapp.json
├── manifest.json
├── buidler.config.js
└── package.json
  • app: Frontend folder. Completely encapsulated: has its own package.json and dependencies.
    • src: Source files.
    • package.json: Frontend npm configuration file.
  • contracts: Smart contracts folder.
    • CounterApp.sol: AragonApp contract example.
  • test: Tests folder.
  • arapp.json: Aragon configuration file. Includes Aragon-specific metadata for your app.
  • manifest.json: Aragon configuration file. Includes web-specific configuration.
  • buidler.config.js: Buidler configuration file.
  • package.json: Main npm configuration file.

Libraries