• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
3.40 star(s)
Part of the CryptoKitties Ethereum network crushing 'smart contract' - in 'C' like Golang. The returned unsigned int from the line in bold is literally worth a six figure sum.

/// @notice Have a pregnant Kitty give birth!
/// @param _matronId A Kitty ready to give birth.
/// @return The Kitty ID of the new kitten.
/// @dev Looks at a given Kitty and, if pregnant and if the gestation period has passed,
/// combines the genes of the two parents to create a new kitten. The new Kitty is assigned
/// to the current owner of the matron. Upon successful completion, both the matron and the
/// new kitten will be ready to breed again. Note that anyone can call this function (if they
/// are willing to pay the gas!), but the new kitten always goes to the mother's owner.
function giveBirth(uint256 _matronId)
external
whenNotPaused
returns(uint256)
{
// Grab a reference to the matron in storage.
Kitty storage matron = kitties[_matronId];

// Check that the matron is a valid cat.
require(matron.birthTime != 0);

// Check that the matron is pregnant, and that its time has come!
require(_isReadyToGiveBirth(matron));

// Grab a reference to the sire in storage.
uint256 sireId = matron.siringWithId;
Kitty storage sire = kitties[sireId];

// Determine the higher generation number of the two parents
uint16 parentGen = matron.generation;
if (sire.generation > matron.generation) {
parentGen = sire.generation;
}

// Call the sooper-sekret gene mixing operation.
uint256 childGenes = geneScience.mixGenes(matron.genes, sire.genes, matron.cooldownEndBlock - 1);

// Make the new kitten!
address owner = kittyIndexToOwner[_matronId];
uint256 kittenId = _createKitty(_matronId, matron.siringWithId, parentGen + 1, childGenes, owner);

// Clear the reference to sire from the matron (REQUIRED! Having siringWithId
// set is what marks a matron as being pregnant.)
delete matron.siringWithId;

// Every time a kitty gives birth counter is decremented.
pregnantKitties--;

// Send the balance fee to the person who made birth happen.
msg.sender.send(autoBirthFee);

// return the new kitten's ID
return kittenId;
}

That's Solidity, not Golang; the reference implementation is in Golang...
 
btc near 15k. 50 and 100 day moving averages are still looking bullish though...

bitcoin-h1-pepperstone-group-limited.png
 
Fibonacci sequence number 13 was reached, so $14.3k should really be the top.

It's going to be the mother of all bloodbaths.

And yet it's pushed through and now $15,154 on coinmarketcap - I honestly don't think the rules apply to this one.

I'm all out so really want a crash asap! I'm worried it will go all the way to $25k
 
Is USDT 1:1 with the USD? Can you withdraw it to a wallet, and do you trust it rather than just selling for USD or EUR?

Cheers in advance

Yes to all 3, although there are small fluctuations if you look at coinmarketcap.com. USDT is the only option on the exchanges I use.
 
And yet it's pushed through and now $15,154 on coinmarketcap - I honestly don't think the rules apply to this one.

I'm all out so really want a crash asap! I'm worried it will go all the way to $25k

The rules always apply. It will go to $25k, but $21k will come first then $34k. $25k will happen after the correction and after the $21k correction.
 
Yes to all 3, although there are small fluctuations if you look at coinmarketcap.com. USDT is the only option on the exchanges I use.

It is. Although USDT got hacked recently.
 

Advertisers

Back
Top