Skip to content

Instantly share code, notes, and snippets.

View nand2's full-sized avatar

nand2

  • Annecy, France
View GitHub Profile
---
eip: 6860
title: Web3 URL to EVM Call Message Translation
description: A translation of an HTTP-style Web3 URL to an EVM call message
author: Qi Zhou (@qizhou), Chao Pi (@pichaoqkc), Sam Wilson (@SamWilsn)
discussions-to: https://ethereum-magicians.org/t/eip-4804-web3-url-to-evm-call-message-translation/8300
status: Draft
type: Standards Track
category: ERC
created: 2023-09-29
interface ITokenMetadata {
    struct tokenOutput {
        // text/html, image/svg+xml, image/png, ...
        string mimeType;
        bytes output;
    };

    function getTokenPreview(uint256 tokenId) external view returns (string memory);
```
interface ITokenMetadata {
struct tokenOutput {
// text/html, image/svg+xml, image/png, ...
string mimeType;
bytes output;
};
function getTokenPreview(uint256 tokenId) external view returns (string memory);
function computeRemainingTime(ratio_updated) {
var averageBlockTime = 12;
var blockGasIncrease = (20-3)/2; // Gross average of gas increase
var requiredGasLimit = 21000;
var currentGasLimit = eth.getBlock("latest").gasLimit;
var GasLimitDelta = requiredGasLimit - currentGasLimit;
var increasingBlockRatio = (ratio_updated - (1 - ratio_updated));
var necessaryBlocks = (GasLimitDelta / increasingBlockRatio) / blockGasIncrease;
var necessaryTime = necessaryBlocks * averageBlockTime;
@nand2
nand2 / gist:11cdac05085ad652ef10
Created May 29, 2014 11:38
Update of rig price on Betarigs using its API
<?php
// Config
$base_api_url = "https://www.betarigs.com/api/v1";
$rig_id = 1;
$percent_above_market_price = 10;
$minimum_per_speed_unit_price = 0.001;
$api_key = 'XXX';
echo "[" . date('Y-m-d H:i:s') . "] Launching price updating of rig $rig_id\n";
<?php
// Config
$base_api_url = "https://www.betarigs.com/api/v1";
$rig_id = 1;
$percent_above_market_price = 10;
$minimum_per_speed_unit_price = 0.001;
$api_key = 'XXX';
echo "[" . date('Y-m-d H:i:s') . "] Launching price updating of rig $rig_id\n";
<?php
// Config
$base_api_url = "https://www.betarigs.com/api/v1";
$rig_id = 4737;
echo "[" . date('Y-m-d H:i:s') . "] Getting infos about rig $rig_id ...\n";
$url = $base_api_url . '/rig/' . $rig_id;
@nand2
nand2 / gist:11e02c10fd4699212ff7
Created May 29, 2014 10:09
Update of rig price on Betarigs using its API
<?php
// Config
$base_api_url = "https://www.betarigs.com/api/v1";
$rig_id = 1;
$percent_above_market_price = 10;
$minimum_per_speed_unit_price = 0.001;
$api_key = 'XXX';
echo "[" . date('Y-m-d H:i:s') . "] Launching price updating of rig $rig_id\n";
Test. Am I still broken?