Linked Questions

39
votes
8answers
20k views

How to quickly test a Solidity function?

There are snippets and functions of Solidity code provided on this Ethereum Stack Exchange and other sites. What are ways to quickly test them, possibly debug a little, and play around?
15
votes
3answers
18k views

Call function on another contract

I've created a contract called "Name" which I've deployed to the testnet. this function just register some text for the user and display it back. My contract is: contract Name is mortal{ ...
20
votes
2answers
3k views

Explanation of Parity Library Suicide

So today, A vulnerability found within the Parity walletLibrary which resulted in freezings of potentially hundreds of millions of dollars from wallets using parity multi-sig. Can someone technically ...
27
votes
1answer
13k views

How does the delegatecall method work to call to another contract's method?

I'm trying to figure out how to use the delegatecall method on a contract address in a contract to call a function in a separate contract. I know Libraries are the higher level interface to use but I ...
5
votes
1answer
2k views

Interaction between two smart contracts - 'call' function fails. Why?

I have read a number of posts about making calls between contracts, but I can't get this simple example to work that involves two contracts that are already deployed on my private Ethereum blockchain. ...
6
votes
1answer
557 views

Specify sender between contract calls

Is it possible when calling a contract from another one to specify the sender? Something like the API exposed by web3. function sendTokensToContract() { //Send tokens from this contract to ...
0
votes
2answers
619 views

How to preserve msg.sender==B when user A calls contract B which calls contract C which calls contract library D?

I have user A which calls contract B which calls contract C which calls contract D. How to call external library D from contract C while preserving msg.sender==B ? Of course, I cannot use tx.origin ...
4
votes
1answer
386 views

Calling a function on an existing contract

I'm trying to create a very simple proxy contract that forwards my transaction/call and nothing else. So User A > transaction to P(roxy)C > Call to Contract (msg.sender = user A) i've tried two ...
5
votes
1answer
369 views

How to protect against DELEGATECALL in a hub-spoke contract model?

Say I have a "master" contract that can create other "servant" contracts. The master contract routes users into different servant contracts and each servant contract should only be able to be accessed ...
3
votes
2answers
356 views

Change ERC20 Transfer function to account for contract as sender

I have a contract we will call A that uses the transfer function from an ERC20 contract we will call B through an interface. However, the transfer function will not work as expected because in the ...
3
votes
2answers
337 views

Solidity CALL and DELEGATECALL: messages and data format

I have some questions about Solidity CALL and DELEGATECALL. I have already read some related threads (link), but found no answers to my doubts. 1) Is there any difference in performing a CALL to a ...
7
votes
0answers
490 views

How can a proxy contract create another contract? [duplicate]

A simple proxy contract looks like: contract Proxy { function forward(address to, uint value, bytes data) { if (!to.call.value(value)(data)) { throw; } } } Using ...
1
vote
0answers
387 views

delegatecall executes but does not change state

I am trying to make use of delegatecall function in solidity. function delegateTokens(uint256 _value) returns (bool result) { tokens[msg.sender] = _value; return token.delegatecall(bytes4(...
3
votes
1answer
219 views

Help to understand library linking and the multisig hack [duplicate]

Just read about the today issue with parity multisig wallets, https://paritytech.io/blog/security-alert.html where as far I can understand the problem is that a library linked to many wallets was ...
0
votes
1answer
279 views

How to use Role-Based Access Control via Proxy?

I have a PermissionsManager contract that uses OpenZeppelin's Role-Based Access Control (RBAC) template as a base. Currently function modifiers in my app call PermissionsManager directly to check for ...

15 30 50 per page