A New Token for Pic One

Pic One
3 min readSep 17, 2019

--

Current holders of Pic One tokens will have the opportunity to swap it 1:1 when the new tokens are launched.

Why are we creating a new token for Pic One?

Background

Our team at P1 Labs set the highest standards possible to create the best gaming experiences. Throughout the development process for the game, we have hired and leaned on third party specialists in game theory, smart contract auditors, as well as developers who gave their best delivering Pic One.

Unfortunately, there were some recommendations for minor optimizations which led to a critical bug that enabled the potential unlimited distribution of PIC tokens by the owner of the token issuance address. We take responsibility for this and have worked quickly to come up with an ideal solution.

Although this issue poses a relatively small threat (see risk evaluation below), it could critically disrupt and damage the long-term sustainability of our token and the platform.

Given this situation, we have decided to resolve it at an early manageable stage, as outlined below.

Risk evaluation of smart contract bug

The bug lies in the omission of final line in the distribution function the total amount of Pic tokens distributed is not returned.

function distribution(address[] memory holdersAddresses, uint256[] memory volumeArray, uint256 _todayEmission, uint256 totalVolume) internal returns (uint256) {
uint256 amountEmitted = 0;
for (uint i = 0; i < holdersAddresses.length; i++) {
uint volume = volumeArray[i];
uint256 amount = _todayEmission.div(totalVolume);
amount = amount.mul(volume);
address holderAddr = holdersAddresses[i];
if(amount > 0){
_mint(holderAddr, amount);
amountEmitted = amountEmitted.add(amount);
}
}
//should return amountEmitted here.
}

To find out why unlimited amount of Pic Tokens can be emitted, it is important to look at how the distribution is being consumed by the distribute function right below.

function distribute(address[] memory holdersAddresses, uint256[] memory volumeArray, uint256 totalVolume) public onlyAdmin returns (uint256) {
// Distribute the emitted tokens
uint256 _amount = distribution(holdersAddresses, volumeArray, todayEmission, totalVolume);
todayEmissionLeft = todayEmissionLeft.sub(_amount);
}

As you can see since, the `amountEmitted` is never returned, the state of todayEmissionLeft is never updated to the correct value which will eventually led to unlimited emission of Pic One tokens.

If the bug was caught earlier, the amount > 0 check will fail eventually as todayEmissionLeft is updated and emission will work as expected.

if(amount > 0){
_mint(holderAddr, amount);
amountEmitted = amountEmitted.add(amount);
}

It will be like breaking all our chicken eggs before they hatch.

We’ve decided to create one of the fairest token distributions in the cryptocurrency space: one that is in line with our long-term vision, where only the most loyal and ardent supporters (both internally and externally) of Pic One will stand to gain from the success of the game. There are no tokens pre-mined and tokens can only be earned by playing on Pic One. It was designed in such a way so that pumps and dumps can never be conducted.

We have the community’s best interest at heart.

As the team at P1 Labs envisions Pic One to be a popular social gambling platform with a strong fan base, we understand prioritizing user experience in our game design.

Therefore, besides ironing out this smart contract issue, we will endeavor to create enjoyable and rewarding gameplay and an economically sound PIC token, is utilized by the platform, and incentivizes users to possess and trade it.

Moving forward, we aim to ensure the platform is robust and ready for production release. There will be more news on this soon!

CONCLUSION

So here’s what we are going to do.

  1. Fix the bug in the smart contract, review our internal procedures and ensure that such mistakes are extremely unlikely to recur
  2. Provide a 1:1 token swap for holders of Pic One tokens when the new token is minted
  3. Provide a full refund for players who have lost ETH on Pic One during the first five days of our launch before the bug was discovered. (Please give us a few days to compile an audit report)

Thank you for your understanding. Please contact support@piclabs.co if you have any further questions or ask us in our Discord

--

--