Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The current validity bond is less than half of the previous validity bond. #1093

Closed
CrystalBallBe opened this issue Feb 21, 2019 · 4 comments

Comments

Projects
None yet
3 participants
@CrystalBallBe
Copy link

commented Feb 21, 2019

From my understanding, the current validity bond will not be less than half of the previous one.
But It seems to me that it has decreased by about 62.4%.

  • The previous validity bond is that:
    validityBond [InAttoEth]: 26994944668340618
    blockNumber: 7246596
    timestamp(UTC datetime): 1550707195(2019-02-20 23:59:55)

  • The current validity bond is that:
    validityBond [InAttoEth]: 10154469944833033
    blockNumber: 7246597
    timestamp(UTC datetime): 1550707220(2019-02-21 00:00:20)

I got these values by calling the contract function getOrCacheValidityBond using Web3.js.

'use strict';
const Web3 = require('web3');
main();

async function main(){
  const web3 = new Web3('https://eth-mainnet.alchemyapi.io/jsonrpc/7sE1TzCIRIQA3NJPD5wg7YRiVjhxuWAE');
  const abi = getAbi();
  const universeAddress = '0xe991247b78f937d7b69cfc00f1a487a293557677';
  const contract = new web3.eth.Contract(abi.Universe,universeAddress);
  
  let blockNumber = 0;
  let validityBondInAttoEth =0;
  
  //"blockNumber": 7246596, "timeUtc": "2019-02-20 23:59:55", "timestamp": 1550707195,
  blockNumber = 7246596;
  validityBondInAttoEth = await contract.methods.getOrCacheValidityBond().call(undefined,blockNumber);
  console.log('blockNumber:'+blockNumber+'\n'+'validityBondInAttoEth:'+validityBondInAttoEth+'\n');
  
  //"blockNumber": 7246597, "timeUtc": "2019-02-21 00:00:20",  "timestamp": 1550707220, 
  blockNumber += 1;
  validityBondInAttoEth = await contract.methods.getOrCacheValidityBond().call(undefined,blockNumber);
  console.log('blockNumber:'+blockNumber+'\n'+'validityBondInAttoEth:'+validityBondInAttoEth+'\n');
  
}
function getAbi(){
  return     {
    "Universe": [
    {
      "constant": false,
      "inputs": [],
      "name": "getOrCacheValidityBond",
      "outputs": [
        {
          "name": "",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    }
    ]
  }
}

The result is that:

blockNumber:7246596
validityBondInAttoEth:26994944668340618

blockNumber:7246597
validityBondInAttoEth:10154469944833033

For your reference, the whitepaper says as follow:
201922101

@nuevoalex

This comment has been minimized.

Copy link
Member

commented Feb 21, 2019

This is a bug in the v1 contracts where if no markets resolve in a given week the bond will return to its original default value. It should instead stay the same as it was previously.

@pgebheim

This comment has been minimized.

Copy link
Member

commented Feb 21, 2019

Ah yes, there's nothing we can do about this for v1 but it has been fixed in the v2 code already iirc.

We don't have a ticket for that because it was in Clubhouse -- but @nuevoalex I think we should basically mark this as a dupe.

Can you add a link to the fixed code for perpetuity and we can dupe this?

@CrystalBallBe -- Thanks for investigating this!

@pgebheim

This comment has been minimized.

Copy link
Member

commented Feb 23, 2019

I'm wrong about that above feedback.

@nuevoalex Did you schedule fixing this?

@nuevoalex

This comment has been minimized.

Copy link
Member

commented Feb 23, 2019

Yup! There's a task in the backlog

@pgebheim pgebheim closed this May 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.