Coder Social home page Coder Social logo

tokenscript-templates's Introduction

TokenScript-Templates

Welcome to the TokenScript Template repository.

Summary

The TokenScript framework is optimised for developing user friendly Tokenised interfaces.

Utilising web technologies a TokenScript can be created to display information and enable interactions to be made using both on and off chain technologies inside a secure environment.

Development

Prerequisites

Docs and Resources

Device Support

TokenScript enabled technologies:

Email us at [email protected] if you would like to add support for TokenScript to your Wallet or Web platform.

tokenscript-templates's People

Contributors

futantan avatar micwallace avatar nicktaras avatar oleggrib avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

tokenscript-templates's Issues

ENS-1155 Renewal of Token Expiry

Whilst developing the ENS-1155 solution there were issues found when trying to renew a tokens expiry, to mimic the same functionality via the ENS-721 solution.

Steps to re-create the issue:

Expected error:

Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (reason="execution reverted", method="estimateGas", transaction={"from":"0x7abaEd470E89820738B5e58874dFa7a77F9Cd44d","to":"0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85","data":"0xc475abff22bc263f964cc8eb063fab871e2501b69d210341f05969918ff6e3afd73f92060000000000000000000000000000000000000000000000000000000001e13380","accessList":null}, error={"code":-32000,"message":"execution reverted"}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.7.2)

Towards investigating this issue - when re-creating this scenario with Ethers JS the transaction can reach the wallet for confirmation.

const contractAddress = '0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85';

const contractABI = [
  {
    "constant": false,
    "inputs": [
      { "internalType": "uint256", "name": "id", "type": "uint256" },
      { "internalType": "uint256", "name": "duration", "type": "uint256" }
    ],
    "name": "renew",
    "outputs": [
      { "internalType": "uint256", "name": "", "type": "uint256" }
    ],
    "payable": false,
    "stateMutability": "nonpayable",
    "type": "function"
  }
];

async function renewContract() {

  var wallet = 'YOUR_WALLET_SIGNER';

  const contract = new _ethers.Contract(contractAddress, contractABI, wallet);

  const id = 'token id'; (decimal)
  const duration = 31536000n;

  try {
    const transaction = await contract.renew(id, duration, { gasLimit: 200000 });
    await transaction.wait();
    console.log('Transaction successful:', transaction.hash);
  } catch (error) {
    console.error('Transaction failed:', error.message);
  }
}

renewContract();

At this time, I'm unsure if this is a TS issue or if there is a misconfiguration on my side.

cc: @futantan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.