Skip to content

Instantly share code, notes, and snippets.

View wivern-co-uk's full-sized avatar
🇺🇦
Focusing

wivern-co-uk

🇺🇦
Focusing
View GitHub Profile
@wivern-co-uk
wivern-co-uk / pancake-reserves.js
Created April 28, 2021 13:10
Batch RPC calls
updatePrices() {
const batch = new web3.eth.BatchRequest()
this.pairs = []
const requests = [];
serializedPairs.forEach(lp => {
requests.push(new Promise((resolve, reject) => {
const contract = new web3.eth.Contract(pancakePairAbis, lp.pair.address)
batch.add(contract.methods.getReserves().call.request((error, reserves) => {
<?php
class FluentCounter
{
private $count = 0;
public function count() : self
{
$this->count += 1;
return $this;