Skip to content

Commit

Permalink
Merge pull request #165 from skalenetwork/feature/SKALE-2284-minting
Browse files Browse the repository at this point in the history
Feature/skale 2284 minting
  • Loading branch information
DimaStebaev authored Apr 17, 2020
2 parents a5df489 + d679f94 commit 2558730
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 21 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.1
1.1.2
9 changes: 0 additions & 9 deletions contracts/SkaleToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,6 @@ contract SkaleToken is LockableERC777, Permissions, IDelegatableToken {
LockableERC777("SKALE", "SKL", defOps) public
{
Permissions.initialize(contractsAddress);

// TODO remove after testing
uint money = 5e9 * 10 ** DECIMALS;
_mint(
address(0),
address(msg.sender),
money, bytes(""),
bytes("")
);
}

/**
Expand Down
19 changes: 9 additions & 10 deletions migrations/1_deploy_skale_manager_system.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,15 @@ async function deploy(deployer, networkName, accounts) {
console.log("Contract Skale Token with address", SkaleToken.address, "registred in Contract Manager");
});

// TODO: Remove after testing
const skaleToken = await SkaleToken.deployed();
await skaleToken.transfer(
deployed.get("SkaleManager").address,
"1000000000000000000000000000");
if (!production) {
// TODO: Remove after testing
const skaleToken = await SkaleToken.deployed();
const money = "5000000000000000000000000000"; // 5e9 * 1e18
await skaleToken.mint(deployAccount, deployAccount, money, "0x", "0x");
await skaleToken.transfer(
deployed.get("SkaleManager").address,
"1000000000000000000000000000");
}

console.log('Deploy done, writing results...');

Expand All @@ -169,12 +173,7 @@ async function deploy(deployer, networkName, accounts) {
}

await fsPromises.writeFile(`data/${networkName}.json`, JSON.stringify(jsonObject));
await sleep(10000);
console.log(`Done, check ${networkName}.json file in data folder.`);
}

function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}

module.exports = deploy;
1 change: 1 addition & 0 deletions test/SkaleManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ contract("SkaleManager", ([owner, validator, developer, hacker, nodeAddress]) =>
const prefix = "0x000000000000000000000000";
const premined = "100000000000000000000000000";
await skaleToken.mint(owner, skaleManager.address, premined, "0x", "0x");
await skaleToken.mint(owner, owner, premined, "0x", "0x");
await constantsHolder.setMSR(5);
await constantsHolder.setLaunchTimestamp(0); // to allow bounty withdrawing
});
Expand Down
3 changes: 3 additions & 0 deletions test/SkaleToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ contract("SkaleToken", ([owner, holder, receiver, nilAddress, accountWith99]) =>

contractManager = await deployContractManager();
skaleToken = await deploySkaleToken(contractManager);

const premined = "5000000000000000000000000000"; // 5e9 * 1e18
await skaleToken.mint(owner, owner, premined, "0x", "0x");
});

it("should have the correct name", async () => {
Expand Down
3 changes: 2 additions & 1 deletion test/delegation/Delegation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ contract("Delegation", ([owner,
it("should not consume extra gas for slashing calculation if holder has never delegated", async () => {
const amount = 100;
await skaleToken.mint(owner, validator, amount, "0x", "0x");
console.log(await skaleToken.balanceOf(validator));
// make owner balance non zero to do not affect transfer costs
await skaleToken.mint(owner, owner, 1, "0x", "0x");
let tx = await skaleToken.transfer(owner, 1, {from: validator});
const gasUsedBeforeSlashing = tx.receipt.gasUsed;
for (let i = 0; i < 10; ++i) {
Expand Down

0 comments on commit 2558730

Please sign in to comment.