10

The easiest is to use remixd to share your build directory with remix. Here are indication how to configure it Accessing a shared folder in Remix IDE using Remixd. Another option is to use the remix feature that allows importing directly from github, so you do not need the openzeppelin files. pragma solidity ^0.4.15; import "github.com/OpenZeppelin/...


6

The origin of the issue is because you're trying to deploy the contract from the file migrations/1_initial_migration.js that is supposed to be used only for the deployment of Migration.sol. To deploy your contracts, you need to create a file in migrations/2_deploy_contracts.js that contains the deployment part of TestCrowsale.sol migrations/...


5

That is not a transfer operations but an event notification. This is done that way so block explorer and wallets that only interpret the 'Transfer' event can show the operation to the user. There were some complaint from users that the transfer failed because it didn't show up in their wallet (or block explorer). Only the 'Transfer' event is part of the ...


5

SafeMath's functions are all declared as internal. That means that the library doesn't actually have to be deployed, as the functions are 'inlined' by the compiler: their code is just copied from the library code to the calling function. An inheritance relationship like contract A is B, A is a B. In case of SafeMath, that does not hold if I just want to ...


5

No, OpenZeppelin doesn't make security audits. OpenZeppelin is a community project that builds a framework of reusable smart contracts. The project doesn't offer any auditing services for things not related to the development this framework. The confusion arises because OpenZeppelin was started by the Zeppelin company. Zeppelin is the main supporter of the ...


5

OpenZeppelin uses the "unstructured storage" proxy pattern. See the documentation for details: https://docs.openzeppelin.com/sdk/2.5/pattern OpenZeppelin in the proxy patterns blog post (https://blog.openzeppelin.com/proxy-patterns/) explored three proxy pattern options: Inherited Storage Eternal Storage Unstructured Storage An upgradeable contract ...


4

We had some of the same problems as you did. What we figured out was the following: startTime and endTime must be set so that when you call the contract, you are in fact buying tokens when the sale is open. We added a hasStarted() method and called both this and the hasEnded() method to make sure that we were in fact within the sale period. The startTime ...


4

Check any abstract/interface methods are being implemented correctly. I get this issue, where it compiles but won't deploy, when I fail to implement abstract/interface methods correctly in inheriting contracts. Edit: Also check all the require statements in the Crowdsale constructor will pass. Maybe try with hardcoding a startTime definitely in the future ...


4

OZ has updated their code besides restructuring some of the folders. Old Answer (pre 2.X.X release) Look here: https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/ERC20/BasicToken.sol Your direct answer: totalSupply_ (the underscore) is the variable name you're looking for. Current Answer Update (12/11/18): uint256 private ...


4

Their documentation isn't the clearest on this one. https://docs.zeppelinos.org/docs/deploying.html Note that we are using a specific address for the --from option which is different to the default address that ganache-cli would use. This is because we need to use different addresses in order to create upgradeable contracts and to query them. This problem ...


4

Etherscan will recognize your contract once it will log its first Transfer event. This is how it works. Though, even before the first Transfer event was logged, you may view your contract in token tracker: https://rinkeby.etherscan.io/tokens?q=0x5238fFeAEdfc9481bd635B6E0e5eF3b05b19762a


3

Have you tried Patricio Palladino's truffle-flattener? Truffle Flattener concats solidity files developed under Truffle with all of their dependencies. This tool helps you to verify contracts developed with Truffle on Etherscan, or debugging them on Remix, by merging your files and their dependencies in the right order.


3

The Pausable contract you're inheriting from just adds pause and unpause, which updates a state variable paused. But that's all it does by itself. You'll need to use the modifiers whenPaused and whenNotPaused in your contract. If you put whenNotPaused on a function, then that function won't be callable when the contract is in the paused state. (For example, ...


3

How do you use it to protect your code? Functions of SafeMath check logic conditions of math operations. function sub(uint256 a, uint256 b... assert(b <= a); // otherwise, subtracting b when (b > a) will cause integer underflow function add(uint256 a, uint256 b... uint256 c = a + b; assert(c >= a); // if the addition will cause ...


3

Truffle 4.0 has optimization turned off by default, so you'll probably want to both increase supplied gas and turn optimization on so the gas used on creation is considerably reduced: module.exports = { networks: { development: { host: "localhost", port: 8545, network_id: "*", // Match any network id gas: 4500000 } }, ...


3

The library SafeERC20 is to safely interact with a third party token. It is not to be used inside your own token contract. OpenZeppelin contracts already have require to check for preconditions so they will return true or fail early. Also I'd suggest to remove the protection for short address attack onlyPayloadSize. They were removed from the OpenZeppelin ...


3

According to the ERC20 standard totalSupply returns an uint. Hence, this should be the amount of tokens in the smallest unit your token offers. This is not in Wei or any Ether unit, this is just the number of tokens (in your smallest unit) which you decide that exist. Still, your token can specify decimals. For example, if you set uint8 public constant ...


3

For example, when you create a new RefundVault inside of the crowdsale you pass in an address in the constructor. What address should this be? That's the crowdsale's wallet address. The Crowdsale contract has a wallet state variable storing the addess to which the funds raised will be sent. The RefundVault contract used by the RefundableCrowdsale works ...


3

The best option to fix your broken tests is to cast following code from the _deliverTokens function in Zeppelin's new "MintedCrowdsale.sol"(Zeppelin version 1.8) file in the following way: MintableToken(token).mint(beneficiary, amount); This allows for a compile, passing tests, and casting your token.


3

It prevents accidental loss of ETH by forbiding to just send ETH to the contract by mistaking, without calling a specific payable function which will handle the payment. Let's create a simple scenario : You want to send ETH to your friend Bob. Except instead of pasting in your favorite third-party app wallet(-manager) like MetaMask or MEW, you pasted the ...


3

The documentation states: Network Configuration By default, solidity-coverage generates a stub truffle.js that accomodates its special gas needs and connects to a coverage-enabled fork of the ganache-cli client called testrpc-sc on port 8555. So, you will have ganache-cli running on port 8545 and a fork of it called testrpc-sc running on port ...


3

This is because Solidity sets up the variables in storage sequentially. So if you move the references of storage variables in the upgraded one, they'll be referring to the wrong slot in storage. Here's an example: contract StorageOriginal { uint public first = 10; uint public second = 20; } and contract StorageNew { uint public second; ...


3

When using the safeTransferFrom function to send ERC721 tokens to a contract address, it will fail unless the receiving contract properly implements the ERC721TokenReceiver interface. (See the ERC721 Standard for details). Any implementation of ERC721TokenReceiver will have the onERC721Received function and will return bytes4(keccak256("onERC721Received(...


3

Your TestToken inherits directly from ERC20Basic. ERC20Basic is an interface. That means that TestToken has to implement the abstract methods ERC20Basic declares before it can be deployed. The error you're getting does not point towards this problem, which I think is a flaw, but it's thrown when you try to deploy a contract that does not implement all ...


3

Here are the full steps starting from a blank truffle project. You could replace truffle init with truffle unbox <package> if you want to start from a Truffle box. Create a new directory truffle init: initialize truffle in the directory truffle install zeppelin: install open-zeppelin using ETH Package Manager A new folder will be created called ...


3

Change token = 0x0f26c1c05f1bbBC7Eff0488F1a98619e8a9758cf; To token = ERC20(0x0f26c1c05f1bbBC7Eff0488F1a98619e8a9758cf); token is of type ERC20, and you are trying to assign it a value of type address. You need to explicitly cast it.


2

Fixed! Solutions tried (in order): update node and npm (stable version) use earlier version of Python (I use 3.5): --python=python2.7 install scrypt manually: brew install libgcrypt (re)install or update node-gyp: npm install -g node-gyp set npm python path npm config set python /path/to/executable/python2.7 update node and npm (bleeding edge) I'm not ...


2

SampleCrowdsale is the contract constructor. It is called automatically when the contract is created. You can tell it is the constructor because the name of the method is the same as the name of the contract. You can pass these variables when creating the contract or you could deploy it from within another contract and pass those variables in. You could ...


2

This is likely due to your decimals value. I'm assuming you have the tokens decimals set to 18? Notice that instead of 1000 tokens, you're getting 1,000,000,000,000,000,000, where 18 of those 0s are from your decimals variable and the other 3 are the 1000. This is all expected behavior.


2

Usually syntax errors involving JSON means you're not entering the contract arguments correctly. Are you entering the address in double quotes? For example: "0xbbf289d846208c16edc8474705c748aff07732db" I think this particular example requires you to create a token contract separately and then pass in the address of that token when initializing your ...


Only top voted, non community-wiki answers of a minimum length are eligible