That is correct indeed.
Cannot truffle compile keep getting
Compiling your contractsā¦
Error: Could not find Compiling your contractsā¦
Error: Could not find /Users/josephrogers/Documents/github/proxyContract/contracts/Storage.sol from any sources
at Resolver. (/usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/dist/lib/resolver.js:62:1)
at Generator.next ()
at fulfilled (/usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/dist/lib/resolver.js:5:42)
Truffle v5.1.59 (core: 5.1.59)
Node v15.5.0
josephrogers@Josephs-MacBook-Pro contracts %
at Resolver. (/usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/dist/lib/resolver.js:62:1)
at Generator.next ()
at fulfilled (/usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/dist/lib/resolver.js:5:42)
Truffle v5.1.59 (core: 5.1.59)
Node v15.5.0
Verified that Compiling your contractsā¦
Error: Could not find /Users/josephrogers/Documents/github/proxyContract/contracts/Storage.sol from any sources
at Resolver. (/usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/dist/lib/resolver.js:62:1)
at Generator.next ()
at fulfilled (/usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/dist/lib/resolver.js:5:42)
Truffle v5.1.59 (core: 5.1.59)
Node v15.5.0
Verified that the file exists
pragma solidity 0.5.1;
contract Storage {
mapping (string => uint256) _uintStorage;
mapping (string => address) _addressStorage;
mapping (string => bool) _boolStorage;
mapping (string => string) _stringStorage;
mapping (string => bytes4) _bytesStorage;
address public owner;
bool public _initialized;
}
I am using the following versions
Truffle v5.0.42 (core: 5.0.42)
Solidity v0.5.8 (solc-js)
Node v10.21.0
Web3.js v1.2.1
Do I need to install [email protected]
?
Hey @Joe1
This looks like an error in the import
statements of your contracts.
Double check that the path you specified for Storage.sol
is correct.
If you are sure is right, push your project to github and send me the link to your repo.
Happy learning,
Dani
I will try with the current version.
Iāve been using 0.6.0 for a while now, not quite 7 yet. But it seems like the assembly function delegatecall() signature has been updated, or the function deprecated or somesuch. But Iāve yet to track down a reference that saysā¦to what, exactly. Can anyone point me to the right direction? The function doesnāt have a seperate entry in the Solidity docs by version site. Probably because itās assembly.
Hello @marsrvr Iām having exactly the same problem when trying solc ^0.7.5 version.
This is what i found so far:
https://forum.openzeppelin.com/t/which-version-of-openzeppelin-is-stable-to-create-a-new-currency/4040
Iām now working on implementing, let me know if you have any luck.
edit: This is working for me
fallback () external payable {
address implementation = currentAddress;
require(currentAddress != address(0));
bytes memory data = msg.data;
assembly {
let result := delegatecall(gas(), implementation, add(data, 0x20), mload(data), 0, 0)
let size := returndatasize()
let ptr := mload(0x40)
returndatacopy(ptr, 0, size)
switch result
case 0 {revert(ptr, size)}
default {return(ptr, size)}
}
}
receive() external payable {
}
Yup! That did it! It was that simple. Iāve the whole āAcademy stackā working in Scaffold-ETH, compiling in Solidity 0.8.0 now. Many thanks for the pointers nā tips!
Hi all, I love this course but I think I downloaded the wrong truffle version. The Truffle version Iām working with is v5.2.2 and the Soldity version is v0.5.16.
When I wanted to compile my contract it said this
Compiling your contracts...
===========================
> Compiling ./contracts/Functional.sol
> Compiling ./contracts/Storage.sol
> Compilation warnings encountered:
/Users/sk/proxyContract/contracts/Functional.sol:1:1: Warning: Source file does not specify required compiler version! Consider adding "pragma solidity ^0.5.16;"
^
,/Users/sk/proxyContract/contracts/Storage.sol:1:1: Warning: Source file does not specify required compiler version! Consider adding "pragma solidity ^0.5.16;"
^
> Everything is up to date, there is nothing to compile.
I donāt know what Iāve to do to fix this, or is it good?
Tried to change the pragma solidity to
pragma solidity ^0.5.16;
but still the same error. Does anyone know what Iāve to do?
I thought I fixed it by updating Truffle, but after that was done both the Storage.sol and Function.sol was gone. Had to make the contracts again, but it still gives me the same error.
I tried searching the web for the answer, but didnāt find anything that can help meā¦
Hi @Sil
Please avoid to post the same question in two different threads, I look at all topics so you will always receive your answer no worries.
Thanks,
Dani
Sorry for that!
Just want to start as soon as possible again haha
@dan-i @filip thanks for the clarification of my previous question, one more question I have is in bonus section, we have inherited form the old functional contract and added initialize functionality. However we also wanted to upgrade the setNumberOfDogs() function with onlyModifier, so should we rewrite the setNumberOfDogs() in updated contract?
Hi there, i just wanted to know whether i should dive deep into Yul so as to be a serious developer or it is not that essential ? Meaning whenever we may need some Yul object, it will be easy to find a snippet ??
And a little contribution that could save some time for other students, since i am using solidity 0.8.1 the assembly code needs a few added details:
assembly {
let result := delegatecall(gas(),implementation, add(data, 0x200),mload(data),0,0)
let size := returndatasize()
let ptr := mload(0x40)
returndatacopy(ptr, 0, size)
switch result
case 0 {revert(ptr,size)}
default {return(ptr,size)}
}
Any idea what is going on here ? Maybe im a bit burned by now, but if anyone notices anything please let me know!
It is as if i couldnt fool truffle by indicating dogs.address, i am digging into this but there isnt much about proxyās migration and the AT function
Hey @ArgenFrank, hope you are ok.
Could you please share your code? I would like to replicate the issue by deploying the same contract and migrations files that you have
You can use the āPreformatted Textā Button to encapsulate any kind of code you want to show.
function formatText(){
let words = āIām a preformatted Text box, Please use me wisely!ā
}
Carlos Z.
Hi Carlos, thanks for answering! Here i posted it in stackoverflow a few days ago, full code is here !
If you prefer i can copy the code here too, let me know
Hi @ArgenFrank
The issue is in your assembly code. The course was done with solidity 0.5 but you are using 0.8 therefore probably some things have changed.
Try this one
fallback () payable external {
address implementation = currentAddress;
require(currentAddress != address(0));
bytes memory data = msg.data;
assembly {
calldatacopy(0, 0, calldatasize())
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
returndatacopy(0, 0, returndatasize())
switch result
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
I do not want to take any credit for the assembly code which is I language I am not familiar with, but in this case just let the other devs guide you.
Openzeppelin is the way: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/proxy/Proxy.sol