Skip to content

Instantly share code, notes, and snippets.

@fdemiramon
fdemiramon / FluviClient.js
Last active October 23, 2023 11:29
Call Fluvi in bulk
const axios = require("axios");
const URI = `https://linea-quest.fluvi.io/api/address-mapping/fluvi/bulk`;
const getFluviInfo = async function (ocwAddresses) {
let res = [];
try {
res = await axios(`${URI}`, {
method: "POST",
headers: {
@fdemiramon
fdemiramon / PortalAsData.sol
Last active July 31, 2023 20:28
Naive implementation for Portal as data (opposed to Portal as SC)
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.21;
struct Portal {
string name;
string context;
bool isRevocable;
bytes32[] moduleIds;
}
@fdemiramon
fdemiramon / index.js
Last active March 24, 2022 13:34
Check user's balance (can only be 1 or 0)
// npm install web3
// get the ABI of the contract (https://mumbai.polygonscan.com/address/0xe9239a8324ee9144e6f1af0cab81a5a8d8274551#code)
// store it in ./abis/serieAToken.json
// run `node index`
const Web3 = require('web3')
const fs = require('fs');
const SerieATokenAbi = JSON.parse(fs.readFileSync('./abis/serieAToken.json'));
const web3 = new Web3('https://polygon-mumbai.infura.io/v3/8d675eea201c403e9837891cf0d36a3c');
did:3:kjzl6cwe1jw149mkxukgcrkm1ywh044vvxlm52xx9yaj3ed4me706gw5zzvork8
@fdemiramon
fdemiramon / ConcatName.sol
Last active January 5, 2022 10:11
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.1+commit.df193b15.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity 0.8.1;
interface IConcatNameFactory {
function createConcatName(address concatNameAddress) external returns(address);
}
contract ConcatName {
bytes public name;
@fdemiramon
fdemiramon / wercker.yml
Last active August 29, 2015 14:27
Wercker IDM-IO
box: wercker/php
services:
- wercker/mysql
build:
steps:
- script:
name: Add timezone to php box
code: echo 'date.timezone = "Europe/Paris"' >> $HOME/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- wercker/add-to-known_hosts@1.2.0:
hostname: github.com
@fdemiramon
fdemiramon / pre-commit
Created May 12, 2015 19:13
Pre-commit hook for git with phpcs and phpcbf (auto-correct obvious violations)
#!/bin/sh
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php`
# Determine if a file list is passed
if [ "$#" -eq 1 ]
then
oIFS=$IFS
IFS='
@fdemiramon
fdemiramon / index.htm
Last active August 29, 2015 14:19
Fundshop iframe integration (replace the http://www.example.com by the URL provided)
<iframe id="childframe" src="http://www.example.com/fr/light-simulation-accounts" id="childframe" width="992" frameborder="0" seamless="seamless" scrolling="no" style="height: 1231px;"></iframe>
<script type="text/javascript">
function receiveMessage(event) {
if (event.origin !== "http://www.example.com")
return;
document.getElementById('childframe').style.height = event.data + "px";
}
window.addEventListener("message", receiveMessage, false);
</script>