Skip to content

Instantly share code, notes, and snippets.

@loredanacirstea
loredanacirstea / HOFsExample_yul.sol
Last active May 5, 2020 08:49
HOFs Example in Yul
object "ContractB" {
code {
datacopy(0, dataoffset("Runtime"), datasize("Runtime"))
return(0, datasize("Runtime"))
}
object "Runtime" {
code {
let _calldata := 2048
let _output_pointer := 0
@loredanacirstea
loredanacirstea / TaylorInteract.js
Created May 5, 2020 08:46
Script to interact with the Taylor interpreted contract
const address = '0x7D4150f492f93e2eDD7FC0Fc62c9193b322f75e5'
let provider = ethers.getDefaultProvider('ropsten');
const newUint8 = '0xffffffff11000001';
const newUint32Array3 = '0xffffffff44000000ee000002000000070000000f110000030000042200000411000004';
const castArrayInt32ToUint256 = '0xffffffff77777788ee0000020000000c000000202200000844000003110000204400000312000004000000020000000500000004';
const data = castArrayInt32ToUint256;
@loredanacirstea
loredanacirstea / CurryExample_yul.sol
Created April 27, 2020 11:41
Curried Function example in Yul
object "ContractB" {
code {
datacopy(0, dataoffset("Runtime"), datasize("Runtime"))
return(0, datasize("Runtime"))
}
object "Runtime" {
code {
let _calldata := 2048
let _output_pointer := 0
/*
browser/dType_V2.sol:52:29: TypeError: Invalid type for argument in function call. Invalid implicit conversion from bytes24 to function (struct typeALib.TypeA memory) pure external returns (struct typeALib.TypeA memory) requested.
return typeALib.map(signature, typeAarr);
^-------^
*/
pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
library typeALib {
let baseUrl;
const httpClient = axios;
let filter_Transfer_0 = {};
// Metamask
const provider = new ethers.providers.Web3Provider(web3.currentProvider);
const signer = provider.getSigner();
const baseUrl = 'http://192.168.1.141:5000/api/v1';
const httpClient = axios;
// const web3 = undefined;
let i__to_0 = null;
let i__value_0 = null;
let i__owner_1 = "0xbB5AEb01acF5b75bc36eC01f5137Dd2728FbE983";
// Metamask
const baseUrl = 'http://192.168.1.141:5000/api/v1';
const httpClient = axios;
const web3 = undefined;
let i_id_1 = null;
const pets_id_get_1 = async function(id) {
const url = `${baseUrl}/pets/${id}`;

Tried to think of an easy to implement game idea after today's lunch discussion with @palango . So, this is what I got:

Team-based RockPaperScissors Idea:

  • 2 teams with unlimited number of participants
  • each game finalizes after 1 round
  • each team can pick one of rock, paper, scissors
  • each team picks the move based on a majority of votes of the team members
  • each team member sends the move & an off-chain payment

Security guidelines

Smart contract & protocol security rating

Based on a weighted arithmethic mean or similar of:

  • static analysis tool results (number of bugs, warnings, number of tools used)
  • tests coverage
  • number of audits performed, audit score & auditors ratings (even normal users can audit, with minimal rating per auditor)
  • time on testnets without bugs
Verifying my identity on Peepeth.com 0x294da0df53491926ea2ec5e7ef5585d9975cda32