Skip to content

Instantly share code, notes, and snippets.

View GrandSchtroumpf's full-sized avatar
🏠
Working from home

François GrandSchtroumpf

🏠
Working from home
  • Dapps Nation
  • Nantes
View GitHub Profile
@GrandSchtroumpf
GrandSchtroumpf / flutter_test.dart
Created November 19, 2019 20:42
Test to build integrate a flutter gist inside dartpad
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
@GrandSchtroumpf
GrandSchtroumpf / Project.sol
Last active November 19, 2019 09:12
A naive Solidity contract that manages funds for a project
pragma solidity >=0.5.0 <0.6.0;
// 10000000000000000000 // 10 Ethers
contract Project {
// The address who deployed the contract
address private owner;
// The cap to achieved to fund the project
uint public cap;
// The total funded.
@GrandSchtroumpf
GrandSchtroumpf / plugin-ws.js
Created November 4, 2019 10:55
Exemple using plugin-ws
const pluginWs = require('@remixproject/plugin-ws')
const express = require('express')
const ws = require('express-ws')
const bodyParser = require('body-parser');
const cors = require('cors');
const app = express()
ws(app)
app.use(bodyParser.urlencoded({extended: true}))
{
"accounts": {
"account{0}": "0xca35b7d915458ef540ade6068dfe2f44e8fa733c"
},
"linkReferences": {},
"transactions": [
{
"timestamp": 1563522532175,
"record": {
"value": "0",
@GrandSchtroumpf
GrandSchtroumpf / ERC20.sol
Created July 18, 2019 15:06
Base code for meetup
pragma solidity >=0.5.0 <0.6.0;
import "https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol";
contract ERC20 {
using SafeMath for uint256;
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
event Transfer(address indexed from, address indexed to, uint256 amount);
pragma solidity >=0.5.0 <0.6.0;
import "https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol";
contract ERC20 {
using SafeMath for uint256;
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
event Transfer(address indexed from, address indexed to, uint256 amount);
@GrandSchtroumpf
GrandSchtroumpf / metadata.json
Last active July 2, 2019 14:58
Metadata for workshop1
{
"name": "Workshop 1",
"description": "Workshop for very beginner",
"author": "GrandSchtroumpf",
"stepIds": ["ea9f23cf4a50b4ea8899b75a198daeea"]
}
@GrandSchtroumpf
GrandSchtroumpf / step1.md
Created July 2, 2019 13:43
Step 1 - Discover Solidity

Discover Solidity

This is a simple Markdown File to test Remix Workshops

@GrandSchtroumpf
GrandSchtroumpf / todo.store.ts
Last active June 26, 2019 13:09
Update Todo State
...
import { CollectionState } from 'akita-firebase';
export interface TodoState extends CollectionState<Todo> {}
@Injectable({ providedIn: 'root' })
@StoreConfig({ name: 'todo' })
export class TodoStore extends EntityStore<TodoState> {
constructor() {
super();
@Component({
selector: 'app-root',
template: `
<ul>
<li *ngFor="let todo of todos$ | async">{{ todo.label }}</li>
<button (click)="add()">Add todo</button>
</ul>
`
})
export class AppComponent implements OnInit {