Commit cbd8e2a3 authored by Robert's avatar Robert

Initial commit

parents
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
pragma solidity ^0.4.23;
contract Migrations {
address public owner;
uint public last_completed_migration;
constructor() public {
owner = msg.sender;
}
modifier restricted() {
if (msg.sender == owner) _;
}
function setCompleted(uint completed) public restricted {
last_completed_migration = completed;
}
function upgrade(address new_address) public restricted {
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
}
pragma solidity ^0.4.7;
contract tax {
function output_before(uint money) public returns (uint) {
uint money_before;
uint res1;
money_before=money-3500;
if(money <= 3500){
res1 = 0;
}else if(money_before >0 && money_before<=1500){
res1 = money_before*3/100;
}else if(money_before>1500 && money_before <=4500){
res1 = money_before/10-105;
}else if(money_before>4500 && money_before <=9000){
res1 = money_before*2/10-555;
}else if(money_before>9000 && money_before <= 35000){
res1 = money_before*25/100-1005;
}else if(money_before>35000 && money_before <= 55000){
res1 = money_before*3/10-2755;
}else if(money_before>55000 && money_before <= 80000){
res1 = money_before*35/100-5505;
}else if(money_before>80000){
res1 = money_before*45/100-13505;
}
return res1;
}
function output_after(uint money) public returns (uint) {
uint money_after;
uint res2;
money_after=money-5000;
if(money <= 5000){
res2 = 0;
}else if(money_after >0 && money_after<=3000){
res2 = money_after*3/100;
}else if(money_after>3000 && money_after <=12000){
res2 = money_after/10-210;
}else if(money_after>12000 && money_after <=25000){
res2 = money_after*2/10-1410;
}else if(money_after>25000 && money_after <= 35000){
res2 = money_after*25/100-2660;
}else if(money_after>35000 && money_after <= 55000){
res2 = money_after*3/10-4410;
}else if(money_after>55000 && money_after <= 80000){
res2 = money_after*35/100-7610;
}else if(money_after>80000){
res2 = money_after*45/100-15160;
}
return res2;
}
}
var Migrations = artifacts.require("./Migrations.sol");
module.exports = function(deployer) {
deployer.deploy(Migrations);
};
const tax = artifacts.require("./tax.sol");
module.exports = function(deployer) {
deployer.deploy(tax);
};
\ No newline at end of file
/*
* NB: since truffle-hdwallet-provider 0.0.5 you must wrap HDWallet providers in a
* function when declaring them. Failure to do so will cause commands to hang. ex:
* ```
* mainnet: {
* provider: function() {
* return new HDWalletProvider(mnemonic, 'https://mainnet.infura.io/<infura-key>')
* },
* network_id: '1',
* gas: 4500000,
* gasPrice: 10000000000,
* },
*/
module.exports = {
// See // for more about customizing your Truffle configuration!
networks: {
development: {
host: "10.162.133.31",
port: 7545,
network_id: "*" // Match any network id
}
}
};
\ No newline at end of file
/*
* NB: since truffle-hdwallet-provider 0.0.5 you must wrap HDWallet providers in a
* function when declaring them. Failure to do so will cause commands to hang. ex:
* ```
* mainnet: {
* provider: function() {
* return new HDWalletProvider(mnemonic, 'https://mainnet.infura.io/<infura-key>')
* },
* network_id: '1',
* gas: 4500000,
* gasPrice: 10000000000,
* },
*/
module.exports = {
// See // for more about customizing your Truffle configuration!
networks: {
development: {
host: "10.162.133.31",
port: 7545,
network_id: "*" // Match any network id
}
}
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment