Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/0xpantera/simple-storage-ethgt
Contrato para el workshop Solidity 101 en ETHGT V2
https://github.com/0xpantera/simple-storage-ethgt
Last synced: about 1 month ago
JSON representation
Contrato para el workshop Solidity 101 en ETHGT V2
- Host: GitHub
- URL: https://github.com/0xpantera/simple-storage-ethgt
- Owner: 0xpantera
- Created: 2024-03-22T19:32:21.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-22T19:38:45.000Z (10 months ago)
- Last Synced: 2024-03-22T20:44:21.771Z (10 months ago)
- Language: Solidity
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SimpleStorage
## Uso
### Anvil
Corre el nodo de Ethereum local
```shell
$ anvil
```### Deploy
Forma simple de deployment. Utiliza uno de los private keys generados por anvil. No utiliza scripts.
```shell
$ forge create SimpleStorage --private-key $ANVIL_PRIVATE_KEY
```Deployment a traves de custom scripts al nodo local. Utiliza uno de los private keys generados por anvil y el rpc url de anvil.
```shell
$ forge script script/SimpleStorage.s.sol:DeploySimpleStorage --rpc-url $ANVIL_RPC_URL --private-key $ANVIL_PRIVATE_KEY --broadcast
```Deployment a traves de custom scripts al nodo local. Utiliza un key store encriptado para guardar el private key.
Esto es una mejor practica de seguridad que pasar el private key en la terminal directamente o a traves de una variable de entorno.
```shell
$ forge script script/SimpleStorage.s.sol:DeploySimpleStorage --rpc-url $ANVIL_RPC_URL --account defaultKey --sender 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --broadcast
```### Cast
Traduce un valor hexadecimal a decimal.
```shell
$ cast --to-base {hex} dec
```Importa un private key al key store encriptado.
```shell
$ cast wallet import defaultKey --interactive
```Envia una transaccion al contrato {address} en anvil llamando la funcion "store()" con el private key.
```shell
$ cast send {address} "store(uint256)" 123 --rpc-url $ANVIL_RPC_URL --private-key $ANVIL_PRIVATE_KEY
```Llama la funcion "retrieve()" del contrato {address}. Por ser un view function no incurre costos de gas.
```shell
$ cast call {address} "retrieve()"
```### Test
Corre los tests
```shell
$ forge test
```### Format
Formatea el codigo.
```shell
$ forge fmt
```### Gas Snapshots
```shell
$ forge snapshot
```### Help
```shell
$ forge --help
$ anvil --help
$ cast --help
```## Documentation
https://book.getfoundry.sh/